Removed internal routine detach_process(), and replaced it with a
authorTheodore Tso <tytso@mit.edu>
Sat, 16 Jul 1994 04:03:56 +0000 (04:03 +0000)
committerTheodore Tso <tytso@mit.edu>
Sat, 16 Jul 1994 04:03:56 +0000 (04:03 +0000)
standards replacing daemon() call.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3987 dc483132-0cff-0310-8789-dd5450dbe970

src/slave/ChangeLog [new file with mode: 0644]
src/slave/kpropd.c

diff --git a/src/slave/ChangeLog b/src/slave/ChangeLog
new file mode 100644 (file)
index 0000000..c805c45
--- /dev/null
@@ -0,0 +1,7 @@
+Sat Jul 16 00:01:41 1994  Theodore Y. Ts'o  (tytso at tsx-11)
+
+       * kpropd.c (do_standalone): Replace detach_process() with call to
+         daemon(), which we can now guarantee will be in libc or in the
+         Kerberos library.
+
+
index 42a5a05c622a339dad983cdaf6bce044e020066f..d2d1f564286834c2bfd4b94f8102d4dc119c6f6c 100644 (file)
@@ -98,7 +98,6 @@ krb5_address  receiver_addr;
 void   PRS();
 void   do_standalone();
 void   doit();
-void   detach_process();
 void   kerberos_authenticate();
 krb5_boolean authorized_principal();
 void   recv_database();
@@ -155,7 +154,7 @@ void do_standalone()
                exit(1);
        }
        if (!debug)
-               detach_process();
+               daemon(1, 0);       
 #ifdef PID_FILE
        if ((pidfile = fopen(PID_FILE, "w")) != NULL) {
                fprintf(pidfile, "%d\n", getpid());
@@ -442,43 +441,6 @@ void PRS(argv)
        strcat(temp_file_name, tmp);
 }
 
-void
-detach_process()
-{
-       int     n;
-       
-#if defined(BSD) && BSD >= 199006 
-       daemon(1, 0);
-#else
-       if (fork() > 0)
-               exit(0);
-       n = open("/dev/null", O_RDONLY);
-       (void) dup2(n, 0);
-       (void) dup2(n, 1);
-       (void) dup2(n, 2);
-       if (n > 2)
-               (void) close(n);
-#ifdef SYSV
-       setpgrp();
-#else
-       {
-               /*
-                * The open below may hang on pseudo ttys if the person
-                * who starts named logs out before this point.  Thus,
-                * the need for the timer.
-                */
-               alarm(120);
-               n = open("/dev/tty", O_RDWR);
-               alarm(0);
-               if (n > 0) {
-                       (void) ioctl(n, TIOCNOTTY, (char *)NULL);
-                       (void) close(n);
-               }
-       }
-#endif /* SYSV */
-#endif /* BSD > 199006 */
-}
-
 /*
  * Figure out who's calling on the other end of the connection....
  */