]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Test return value of socket for <0, not ==0 to indicate failure.
authorTed Lemon <source@isc.org>
Sat, 29 Nov 1997 07:51:49 +0000 (07:51 +0000)
committerTed Lemon <source@isc.org>
Sat, 29 Nov 1997 07:51:49 +0000 (07:51 +0000)
common/dns.c

index a56679bc411320ce3ef550545946c6ed8e5116cb..cc98e005a82b423df0a45aeaf826bb62edf5d46f 100644 (file)
@@ -48,7 +48,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dns.c,v 1.4 1997/06/08 04:05:20 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: dns.c,v 1.5 1997/11/29 07:51:49 mellon Exp $ Copyright (c) 1997 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -85,7 +85,7 @@ void dns_startup ()
 
        /* Get a socket for the DNS protocol. */
        dns_protocol_fd = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP);
-       if (!dns_protocol_fd)
+       if (dns_protocol_fd < 0)
                error ("unable to create dns socket: %m");
 
        pick_name_server ();