Merge branch 'master' into next
[paraslash.git] / daemon.c
index cae63ea7f48488124085d79360458ee44b5620a8..0bc4b116e621726a0f1cb963436881c94fa4e6bc 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -5,12 +5,14 @@
  */
 
 /** \file daemon.c Some helpers for programs that detach from the console. */
-#include "para.h"
-#include "daemon.h"
+
+#include <regex.h>
 #include <pwd.h>
 #include <sys/types.h> /* getgrnam() */
 #include <grp.h>
 
+#include "para.h"
+#include "daemon.h"
 #include "string.h"
 #include "color.h"
 
@@ -103,7 +105,7 @@ void daemon_set_logfile(char *logfile_name)
 }
 
 /**
- * Supress log messages with severity lower than the given loglevel.
+ * Suppress log messages with severity lower than the given loglevel.
  *
  * \param loglevel The smallest level that should be logged.
  */
@@ -167,7 +169,6 @@ void daemonize(void)
                goto err;
        if (chdir("/") < 0)
                goto err;
-       umask(0);
        null = open("/dev/null", O_RDONLY);
        if (null < 0)
                goto err;
@@ -284,7 +285,7 @@ void drop_privileges_or_die(const char *username, const char *groupname)
  * set_or_get equal to \p UPTIME_GET return the uptime.
 
  * \return Zero if called with \a set_or_get equal to \p UPTIME_SET, the number
- * of seconds ellapsed since the last reset otherwise.
+ * of seconds elapsed since the last reset otherwise.
  *
  * \sa time(2), difftime(3).
  */