OSSP CVS Repository

ossp - Check-in [1065]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1065
Date: 2001-Oct-04 13:00:38 (local)
2001-Oct-04 11:00:38 (UTC)
User:rse
Branch:
Comment: make it easier for our situation
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/daemon.c      1.1 -> 1.2     3 inserted, 6 deleted
ossp-pkg/lmtp2nntp/daemon.h      1.1 -> 1.2     1 inserted, 1 deleted

ossp-pkg/lmtp2nntp/daemon.c 1.1 -> 1.2

--- daemon.c     2001/10/04 10:57:22     1.1
+++ daemon.c     2001/10/04 11:00:38     1.2
@@ -14,7 +14,7 @@
 
 #include "daemon.h"
 
-int daemonize(int nochdir, int noclose)
+int daemonize(void)
 {
     int fd;
     int rc;
@@ -23,10 +23,8 @@
      * if we are started from init, 
      * no need to become daemon.
      */
-#if 0
     if (getppid() == 1)
         return;
-#endif
 
     /*
      * Ignore tty related signals
@@ -94,8 +92,7 @@
      * [Equivalently, we could change to any directory containing files
      * important to the daemon's operation.] 
      */
-    if (!nochdir)
-        chdir("/");
+    chdir("/");
 
     /*
      * give us complete control over the permissions of anything we write. We
@@ -108,7 +105,7 @@
      * inherited from our parent process. We have no way of knowing where
      * these fds might have been redirected to. 
      */
-    if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) {
+    if ((fd = open("/dev/null", O_RDWR, 0)) != -1) {
         dup2(fd, STDIN_FILENO);
         dup2(fd, STDOUT_FILENO);
         dup2(fd, STDERR_FILENO);


ossp-pkg/lmtp2nntp/daemon.h 1.1 -> 1.2

--- daemon.h     2001/10/04 10:57:22     1.1
+++ daemon.h     2001/10/04 11:00:38     1.2
@@ -1,6 +1,6 @@
 #ifndef _DAEMON_H_
 #define _DAEMON_H_
 
-int daemonize(int, int);
+int daemonize(void);
 
 #endif /* _DAEMON_H_ */

CVSTrac 2.0.1