summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/timers/leapcrash.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/timers/leapcrash.c')
-rw-r--r--tools/testing/selftests/timers/leapcrash.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/tools/testing/selftests/timers/leapcrash.c b/tools/testing/selftests/timers/leapcrash.c
index a1071bdbdeb7..c2d3bccb52f2 100644
--- a/tools/testing/selftests/timers/leapcrash.c
+++ b/tools/testing/selftests/timers/leapcrash.c
@@ -4,10 +4,10 @@
* (C) Copyright 2013, 2015 Linaro Limited
* Licensed under the GPL
*
- * This test demonstrates leapsecond deadlock that is possibe
+ * This test demonstrates leapsecond deadlock that is possible
* on kernels from 2.6.26 to 3.3.
*
- * WARNING: THIS WILL LIKELY HARDHANG SYSTEMS AND MAY LOSE DATA
+ * WARNING: THIS WILL LIKELY HARD HANG SYSTEMS AND MAY LOSE DATA
* RUN AT YOUR OWN RISK!
* To build:
* $ gcc leapcrash.c -o leapcrash -lrt
@@ -22,20 +22,7 @@
#include <sys/timex.h>
#include <string.h>
#include <signal.h>
-#ifdef KTEST
-#include "../kselftest.h"
-#else
-static inline int ksft_exit_pass(void)
-{
- exit(0);
-}
-static inline int ksft_exit_fail(void)
-{
- exit(1);
-}
-#endif
-
-
+#include "kselftest.h"
/* clear NTP time_status & time_state */
int clear_time_state(void)
@@ -100,7 +87,7 @@ int main(void)
tv.tv_usec = 0;
if (settimeofday(&tv, NULL)) {
printf("Error: You're likely not running with proper (ie: root) permissions\n");
- return ksft_exit_fail();
+ ksft_exit_fail();
}
tx.modes = 0;
adjtimex(&tx);
@@ -114,7 +101,8 @@ int main(void)
}
clear_time_state();
printf(".");
+ fflush(stdout);
}
printf("[OK]\n");
- return ksft_exit_pass();
+ ksft_exit_pass();
}