diff options
author | srinivas%netscape.com <devnull@localhost> | 1999-08-24 01:16:59 +0000 |
---|---|---|
committer | srinivas%netscape.com <devnull@localhost> | 1999-08-24 01:16:59 +0000 |
commit | 900e5386cb8fe5601ab82601627a75601dab17cc (patch) | |
tree | 6569bdbab78c559d7c5a88edd684b11283ea88dc | |
parent | 003960facf7f619f74385d95a9dcd82f2311f39d (diff) | |
download | nspr-hg-900e5386cb8fe5601ab82601627a75601dab17cc.tar.gz |
The notifyCount value should be updated only for successful read and writeTREE_WIDGET_19990826_BASE
operations. Checkin for Colin Blake <colin@theblakes.com>.
-rw-r--r-- | lib/ds/plevent.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/ds/plevent.c b/lib/ds/plevent.c index 2ffe4d8a..9f067ab9 100644 --- a/lib/ds/plevent.c +++ b/lib/ds/plevent.c @@ -762,9 +762,13 @@ _pl_NativeNotify(PLEventQueue* self) unsigned char buf[] = { NOTIFY_TOKEN }; count = write(self->eventPipe[1], buf, 1); - self->notifyCount++; - return (count == 1 || (count == -1 && (errno == EAGAIN - || errno == EWOULDBLOCK))) ? PR_SUCCESS : PR_FAILURE; + if (count == 1) { + self->notifyCount++; + return PR_SUCCESS; + } else if ((count == -1) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) { + return PR_SUCCESS; + } else + return PR_FAILURE; }/* --- end _pl_NativeNotify() --- */ #endif /* XP_UNIX */ @@ -820,11 +824,13 @@ _pl_AcknowledgeNativeNotify(PLEventQueue* self) if (self->notifyCount <= 0) return PR_SUCCESS; /* consume the byte NativeNotify put in our pipe: */ count = read(self->eventPipe[0], &c, 1); - self->notifyCount--; - return ((count == 1 && c == NOTIFY_TOKEN) || (count == -1 - && (errno == EAGAIN || errno == EWOULDBLOCK))) - ? PR_SUCCESS : PR_FAILURE; - + if ((count == 1) && (c == NOTIFY_TOKEN)) { + self->notifyCount--; + return PR_SUCCESS; + } else if ((count == -1) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) { + return PR_SUCCESS; + } else + return PR_FAILURE; #else #if defined(XP_MAC) |