]> gitweb @ CieloNegro.org - daemon.git/blobdiff - daemon.c
Added COPYING.
[daemon.git] / daemon.c
index 5b769dd49863cee1d56c120217edf75d0e870720..abc076fdc1526cae3b204c860a90e2065b65a63d 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -30,6 +30,7 @@
 
 #include "config.h"
 #include "pidfile.h"
+#include "getprogname.h"
 
 #include <sys/param.h>
 
@@ -51,9 +52,11 @@ main(int argc, char *argv[])
        const char *pidfile, *user;
        pid_t otherpid;
 
+    setprogname(argv[0]);
+
        nochdir = noclose = 1;
        pidfile = user = NULL;
-       while ((ch = getopt(argc, argv, "-cfp:u:")) != -1) {
+       while ((ch = getopt(argc, argv, "cfp:u:")) != -1) {
                switch (ch) {
                case 'c':
                        nochdir = 0;