From: Theodore Tso Date: Sat, 16 Jul 1994 04:03:56 +0000 (+0000) Subject: Removed internal routine detach_process(), and replaced it with a X-Git-Tag: krb5-1.0-beta4.2~130 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=65ee430918d8404cf26e221fcdee283f70fc656c;p=krb5.git Removed internal routine detach_process(), and replaced it with a standards replacing daemon() call. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3987 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/slave/ChangeLog b/src/slave/ChangeLog new file mode 100644 index 000000000..c805c4557 --- /dev/null +++ b/src/slave/ChangeLog @@ -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. + + diff --git a/src/slave/kpropd.c b/src/slave/kpropd.c index 42a5a05c6..d2d1f5642 100644 --- a/src/slave/kpropd.c +++ b/src/slave/kpropd.c @@ -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.... */