From c01e01264b5475d8545239ac11015229e2e4db30 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 31 Jan 2000 17:18:48 +0000 Subject: return code of socket is -1, not 0 --- src/ppp-watch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ppp-watch.c') diff --git a/src/ppp-watch.c b/src/ppp-watch.c index 8e6357db..645034c3 100644 --- a/src/ppp-watch.c +++ b/src/ppp-watch.c @@ -372,16 +372,16 @@ pppLogicalToPhysical(int *pppdPid, char *logicalName) { static int interfaceStatus(char *device) { - int sock = 0; + int sock = -1; int pfs[] = {AF_INET, AF_IPX, AF_AX25, AF_APPLETALK, 0}; int p = 0; struct ifreq ifr; int retcode = 0; - while (!sock && pfs[p]) { + while ((sock == -1) && pfs[p]) { sock = socket(pfs[p++], SOCK_DGRAM, 0); } - if (!sock) return 0; + if (sock == -1) return 0; memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, device, IFNAMSIZ); -- cgit v1.2.1