sched: Dont use fixed-size buffer for task names.
[paraslash.git] / daemon.c
index 541e44defedc3d17d609dc13b09cf18a94c493e0..05002f4eff228e0200d5d6cdce9be0c697ed3bc3 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1997-2011 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2014 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -10,8 +10,7 @@
 #include <pwd.h>
 #include <sys/types.h> /* getgrnam() */
 #include <grp.h>
-#include <sys/time.h>
-#include <stdbool.h>
+#include <signal.h>
 
 #include "para.h"
 #include "daemon.h"
@@ -65,8 +64,6 @@ void daemon_set_default_log_colors(void)
  * \param arg The loglevel/color specifier.
  *
  * \a arg must be of the form "ll:[fg [bg]] [attr]".
- *
- * \return 1 On success, -1 on errors.
  */
 void daemon_set_log_color_or_die(char const *arg)
 {
@@ -356,7 +353,7 @@ __malloc char *get_server_uptime_str(const struct timeval *current_time)
  * \param ll The log level.
  * \param fmt The format string describing the log message.
  */
-__printf_2_3 void para_log(int ll, const char* fmt,...)
+__printf_2_3 void daemon_log(int ll, const char* fmt,...)
 {
        va_list argp;
        FILE *fp;
@@ -376,7 +373,7 @@ __printf_2_3 void para_log(int ll, const char* fmt,...)
                fprintf(fp, "%s", color);
        if (log_time || log_timing) {
                struct timeval tv;
-               gettimeofday(&tv, NULL);
+               clock_get_realtime(&tv);
                if (daemon_test_flag(DF_LOG_TIME)) { /* print date and time */
                        time_t t1 = tv.tv_sec;
                        char str[100];