summaryrefslogtreecommitdiff
path: root/lib/ZPending.c
diff options
context:
space:
mode:
authorGravatar Robert S. French <rfrench@mit.edu>1987-07-29 11:01:43 +0000
committerGravatar Robert S. French <rfrench@mit.edu>1987-07-29 11:01:43 +0000
commit1fed6997ac034d48df0a77dd71e1425cd2e3cf78 (patch)
tree106b1e2aa57f604c3be6e0d90bf8a93962c214ee /lib/ZPending.c
parent2c25abc55a40e06e837780532cdef47512d49647 (diff)
Added better error handling
Diffstat (limited to 'lib/ZPending.c')
-rw-r--r--lib/ZPending.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/ZPending.c b/lib/ZPending.c
index e087a9a..c5c3471 100644
--- a/lib/ZPending.c
+++ b/lib/ZPending.c
@@ -18,10 +18,17 @@
int ZPending()
{
- if (ZGetFD() < 0)
+ int retval;
+
+ if (ZGetFD() < 0) {
+ errno = ZERR_NOPORT;
return (-1);
-
- (void) Z_ReadEnqueue();
+ }
+
+ if ((retval = Z_ReadEnqueue()) != ZERR_NONE) {
+ errno = retval;
+ return (-1);
+ }
return(ZQLength());
}