diff options
author | Bill Nottingham <notting@redhat.com> | 2000-01-31 17:18:48 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2000-01-31 17:18:48 +0000 |
commit | c01e01264b5475d8545239ac11015229e2e4db30 (patch) | |
tree | 72c5133fe61e21a67f0cec8d0c681308defab4b1 /src/ppp-watch.c | |
parent | 80feece0f3a1c55b06bfd7ba647dd1a398cbd86d (diff) | |
download | initscripts-c01e01264b5475d8545239ac11015229e2e4db30.tar initscripts-c01e01264b5475d8545239ac11015229e2e4db30.tar.gz initscripts-c01e01264b5475d8545239ac11015229e2e4db30.tar.bz2 initscripts-c01e01264b5475d8545239ac11015229e2e4db30.tar.xz initscripts-c01e01264b5475d8545239ac11015229e2e4db30.zip |
return code of socket is -1, not 0
Diffstat (limited to 'src/ppp-watch.c')
-rw-r--r-- | src/ppp-watch.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); |