diff --git a/apps/init.cpp b/apps/init.cpp index 47f4c4c9..6ec99984 100644 --- a/apps/init.cpp +++ b/apps/init.cpp @@ -328,13 +328,15 @@ int main() umask(022); - g_init_log = fopen("/dev/uart0", "w+"); + g_init_log = fopen("/dev/uart0", "w"); + check(g_init_log); + setlinebuf(g_init_log); fcntl(fileno(g_init_log), F_SETFD, FD_CLOEXEC); set_hostname(); - if (signal(SIGTERM, sigterm_handler) == SIG_ERR) do_log("[init] failed to register handler for SIGTERM"); - if (signal(SIGQUIT, sigquit_handler) == SIG_ERR) do_log("[init] failed to register handler for SIGQUIT"); + if (signal(SIGTERM, sigterm_handler) == SIG_ERR) do_log("[init] failed to register handler for SIGTERM\n"); + if (signal(SIGQUIT, sigquit_handler) == SIG_ERR) do_log("[init] failed to register handler for SIGQUIT\n"); start_services();