From: Ted Lemon Date: Sat, 29 Nov 1997 07:51:49 +0000 (+0000) Subject: Test return value of socket for <0, not ==0 to indicate failure. X-Git-Tag: DHCP-971202~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=707260f98f448b47fb74799d4f4ae60d33703c96;p=thirdparty%2Fdhcp.git Test return value of socket for <0, not ==0 to indicate failure. --- diff --git a/common/dns.c b/common/dns.c index a56679bc4..cc98e005a 100644 --- a/common/dns.c +++ b/common/dns.c @@ -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 ();