summaryrefslogtreecommitdiff
path: root/sys/lib/libsa
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2015-08-15 19:42:57 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2015-08-15 19:42:57 +0000
commitd95f32241d81b910948257cadf9f2f9a3f40a4b0 (patch)
tree937f44dd5f7aa7427a7e0b188a899762a7bd88d3 /sys/lib/libsa
parent4a65b846e1262810668c5e103e90820d61de7d45 (diff)
When sendrecv() returns -1, have rpc_call() return -1 as well. Otherwise, due
to the cast to unsigned, it fails the error test and returns a bogus partial read to the caller, which is painful to debug.
Diffstat (limited to 'sys/lib/libsa')
-rw-r--r--sys/lib/libsa/rpc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/lib/libsa/rpc.c b/sys/lib/libsa/rpc.c
index a15a02304ff..4101ff50554 100644
--- a/sys/lib/libsa/rpc.c
+++ b/sys/lib/libsa/rpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rpc.c,v 1.14 2014/07/13 15:31:20 mpi Exp $ */
+/* $OpenBSD: rpc.c,v 1.15 2015/08/15 19:42:56 miod Exp $ */
/* $NetBSD: rpc.c,v 1.16 1996/10/13 02:29:06 christos Exp $ */
/*
@@ -184,7 +184,7 @@ rpc_call(struct iodesc *d, u_int32_t prog, u_int32_t vers, u_int32_t proc, void
if (debug)
printf("callrpc: cc=%d rlen=%d\n", cc, rlen);
#endif
- if (cc < -1)
+ if (cc <= -1)
return (-1);
if ((size_t)cc <= sizeof(*reply)) {