diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2009-07-09 21:49:05 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2009-07-09 21:49:05 +0000 |
commit | 92938e4782c82af08e4ffda40af291c0dc2f1d98 (patch) | |
tree | 57f79ad767bdae73aa3709d9f52195f829c9c59c /net_ntrip.c | |
parent | d64918bc1678e2dc3e2264c7d850019949e04ca9 (diff) | |
download | gpsd-92938e4782c82af08e4ffda40af291c0dc2f1d98.tar.gz |
system call failure should be tested against -1, rather than "< 0"
Diffstat (limited to 'net_ntrip.c')
-rw-r--r-- | net_ntrip.c | 6 |
1 files changed, 3 insertions, 3 deletions
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 */ |