From fb5f87935616067baba656857d1e7fafc71df941 Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Thu, 5 Apr 2001 22:52:48 +0000 Subject: [PATCH] Make sure we have a stdin, stdout and stderr. --- server/dhcpd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/server/dhcpd.c b/server/dhcpd.c index 3504565aa..fadad829c 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -43,7 +43,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcpd.c,v 1.113 2001/03/01 22:11:50 mellon Exp $ Copyright 1995-2001 Internet Software Consortium."; +"$Id: dhcpd.c,v 1.114 2001/04/05 22:52:48 mellon Exp $ Copyright 1995-2001 Internet Software Consortium."; #endif static char copyright[] = @@ -215,6 +215,16 @@ int main (argc, argv, envp) char *traceoutfile = (char *)0; #endif + /* Make sure we have stdin, stdout and stderr. */ + status = open ("/dev/null", O_RDWR); + if (status == 0) + status = open ("/dev/null", O_RDWR); + if (status == 1) { + status = open ("/dev/null", O_RDWR); + log_perror = 0; /* No sense logging to /dev/null. */ + } else if (status != -1) + close (status); + /* Set up the client classification system. */ classification_setup (); -- 2.47.3