Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/dhcp/relay Pull up revision 1.10 (requested by...



details:   https://anonhg.NetBSD.org/src/rev/10e56296ba0c
branches:  netbsd-1-5
changeset: 491269:10e56296ba0c
user:      he <he%NetBSD.org@localhost>
date:      Sat Apr 21 19:43:32 2001 +0000

description:
Pull up revision 1.10 (requested by mellon):
  Fixes the same problem as in PR#12065, although of course the
  symptoms would be different for the relay agent and server.

diffstat:

 usr.sbin/dhcp/relay/dhcrelay.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 0c0b056bef8a -r 10e56296ba0c usr.sbin/dhcp/relay/dhcrelay.c
--- a/usr.sbin/dhcp/relay/dhcrelay.c    Sat Apr 21 19:42:41 2001 +0000
+++ b/usr.sbin/dhcp/relay/dhcrelay.c    Sat Apr 21 19:43:32 2001 +0000
@@ -3,7 +3,7 @@
    DHCP/BOOTP Relay Agent. */
 
 /*
- * Copyright (c) 1997-2000 Internet Software Consortium.
+ * Copyright (c) 1997-2001 Internet Software Consortium.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhcrelay.c,v 1.4.2.3 2001/04/04 20:56:40 he Exp $ Copyright (c) 1997-2000 Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhcrelay.c,v 1.4.2.4 2001/04/21 19:43:32 he Exp $ Copyright (c) 1997-2000 Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -124,6 +124,16 @@
        isc_result_t status;
        char *s;
 
+       /* Make sure we have stdin, stdout and stderr. */
+       i = open ("/dev/null", O_RDWR);
+       if (i == 0)
+               i = open ("/dev/null", O_RDWR);
+       if (i == 1) {
+               i = open ("/dev/null", O_RDWR);
+               log_perror = 0; /* No sense logging to /dev/null. */
+       } else if (i != -1)
+               close (i);
+
 #ifdef SYSLOG_4_2
        openlog ("dhcrelay", LOG_NDELAY);
        log_priority = LOG_DAEMON;



Home | Main Index | Thread Index | Old Index