summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/proto_common.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2012-01-10 22:39:07 +0000
committerpjd <pjd@FreeBSD.org>2012-01-10 22:39:07 +0000
commitc5fe5a76f24f997008c868c17e6fe6ed1b2aaf7b (patch)
tree2219c6a6a85261711a382939a35cabc647cb7775 /sbin/hastd/proto_common.c
parent29f76d890ec6d66428132ae19aece81336519a79 (diff)
downloadFreeBSD-src-c5fe5a76f24f997008c868c17e6fe6ed1b2aaf7b.zip
FreeBSD-src-c5fe5a76f24f997008c868c17e6fe6ed1b2aaf7b.tar.gz
For functions that return -1 on failure check exactly for -1 and not for
any negative number. MFC after: 3 days
Diffstat (limited to 'sbin/hastd/proto_common.c')
-rw-r--r--sbin/hastd/proto_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/hastd/proto_common.c b/sbin/hastd/proto_common.c
index 183b4e4..59b1e39 100644
--- a/sbin/hastd/proto_common.c
+++ b/sbin/hastd/proto_common.c
@@ -116,7 +116,7 @@ proto_common_send(int sock, const unsigned char *data, size_t size, int fd)
done = send(sock, data, sendsize, MSG_NOSIGNAL);
if (done == 0) {
return (ENOTCONN);
- } else if (done < 0) {
+ } else if (done == -1) {
if (errno == EINTR)
continue;
if (errno == ENOBUFS) {
@@ -215,7 +215,7 @@ proto_common_recv(int sock, unsigned char *data, size_t size, int *fdp)
} while (done == -1 && errno == EINTR);
if (done == 0) {
return (ENOTCONN);
- } else if (done < 0) {
+ } else if (done == -1) {
/*
* If this is blocking socket and we got EAGAIN, this
* means the request timed out. Translate errno to
OpenPOWER on IntegriCloud