Skip to content

Commit

Permalink
flush printfs to get them in systemd journal
Browse files Browse the repository at this point in the history
Else they are buffered.
  • Loading branch information
amurzeau committed Jul 9, 2022
1 parent 8445d02 commit 904970e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ int check_rtc_jumped(const struct rtc_time* previous_rtc_time,
printf("RTC time jumped of %lld seconds instead of %lld, syncing system time with rtc\n",
(long long int) diff,
(long long int) expected_seconds_elapsed);

fflush(stdout);
return 1;
}

Expand Down Expand Up @@ -158,6 +160,8 @@ void update_system_time() {
}

close(rtc_fd);

fflush(stdout);
}

int main(int argc, char* argv[]) {
Expand All @@ -168,6 +172,7 @@ int main(int argc, char* argv[]) {

printf("guest-vm-sync-with-rtc version %s\n", VERSION);
printf("Synchronizing system time on RTC jump (check period: %d sec)\n", RTC_CHECK_PERIOD_SEC);
fflush(stdout);

result = read_rtc(&current_rtc_time);

Expand Down

0 comments on commit 904970e

Please sign in to comment.