From 92938e4782c82af08e4ffda40af291c0dc2f1d98 Mon Sep 17 00:00:00 2001 From: Chris Kuethe Date: Thu, 9 Jul 2009 21:49:05 +0000 Subject: system call failure should be tested against -1, rather than "< 0" --- net_ntrip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'net_ntrip.c') diff --git a/net_ntrip.c b/net_ntrip.c index 9cb5d569..6293a23a 100644 --- a/net_ntrip.c +++ b/net_ntrip.c @@ -177,7 +177,7 @@ static int ntrip_sourcetable_parse(int fd, char *buf, ssize_t blen, memset(&buf[len], 0, (size_t)(blen - len)); - if ((rlen = recv(fd, &buf[len], (size_t)(blen - 1 - len), 0)) < 0) { + if ((rlen = recv(fd, &buf[len], (size_t)(blen - 1 - len), 0)) == -1) { if (errno == EINTR) continue; return -1; @@ -284,7 +284,7 @@ static int ntrip_stream_probe(const char *caster, int dsock; char buf[BUFSIZ]; - if ((dsock = netlib_connectsock(caster, port, "tcp")) < 0) { + if ((dsock = netlib_connectsock(caster, port, "tcp")) == -1) { printf("ntrip stream connect error %d\n", dsock); return -1; } @@ -358,7 +358,7 @@ static int ntrip_stream_open(const char *caster, } memset(buf, 0, sizeof(buf)); - if (read(context->dsock, buf, sizeof(buf) - 1) < 0) + if (read(context->dsock, buf, sizeof(buf) - 1) == -1) goto close; /* parse 401 Unauthorized */ -- cgit v1.2.1