diff options
Diffstat (limited to 'lib/ZPending.c')
-rw-r--r-- | lib/ZPending.c | 13 |
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()); } |