summaryrefslogtreecommitdiffstats
path: root/src/slave/kpropd.c
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1994-07-16 04:03:56 +0000
committerTheodore Tso <tytso@mit.edu>1994-07-16 04:03:56 +0000
commit65ee430918d8404cf26e221fcdee283f70fc656c (patch)
tree4863c7e4e4bd57356d9f254381915de70b2e9ca8 /src/slave/kpropd.c
parent95afd1ed28af33313ec9df354524090d9c6261af (diff)
downloadkrb5-65ee430918d8404cf26e221fcdee283f70fc656c.tar.gz
krb5-65ee430918d8404cf26e221fcdee283f70fc656c.tar.xz
krb5-65ee430918d8404cf26e221fcdee283f70fc656c.zip
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
Diffstat (limited to 'src/slave/kpropd.c')
-rw-r--r--src/slave/kpropd.c40
1 files changed, 1 insertions, 39 deletions
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....
*/