Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe483192 authored by Kees Cook's avatar Kees Cook Committed by Shuah Khan
Browse files

selftests/timers: Add missing fflush(stdout) calls



When running under a pipe, some timer tests would not report output in
real-time because stdout flushes were missing after printf()s that lacked
a newline. This adds them to restore real-time status output that humans
can enjoy.

Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent e8108866
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ int check_tick_adj(long tickval)

	eppm = get_ppm_drift();
	printf("%lld usec, %lld ppm", systick + (systick * eppm / MILLION), eppm);
	fflush(stdout);

	tx1.modes = 0;
	adjtimex(&tx1);
+1 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ int main(void)
		}
		clear_time_state();
		printf(".");
		fflush(stdout);
	}
	printf("[OK]\n");
	return ksft_exit_pass();
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ int main(int argc, char **argv)
	int ret;

	printf("Mqueue latency :                          ");
	fflush(stdout);

	ret = mqueue_lat_test();
	if (ret < 0) {
+1 −0
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ int main(int argc, char **argv)
			continue;

		printf("Nanosleep %-31s ", clockstring(clockid));
		fflush(stdout);

		length = 10;
		while (length <= (NSEC_PER_SEC * 10)) {
+1 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ int main(int argc, char **argv)
			continue;

		printf("nsleep latency %-26s ", clockstring(clockid));
		fflush(stdout);

		length = 10;
		while (length <= (NSEC_PER_SEC * 10)) {
Loading