if ((count == 1) && (c == NOTIFY_TOKEN)) { return PR_SUCCESS; } else if ((count == -1) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) { return PR_SUCCESS; } else return PR_FAILURE;
if ((count == 1) && (c == NOTIFY_TOKEN)) return PR_SUCCESS; if ((count == -1) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) return PR_SUCCESS; return PR_FAILURE;
_pl_AcknowledgeNativeNotify(PLEventQueue* self){#if defined(_WIN32) || defined(XP_OS2)#ifdef XP_OS2    QMSG aMsg;#else    MSG aMsg;#endif    /*     * only remove msg when we've been called directly by     * PL_ProcessPendingEvents, not when we've been called by     * the window proc because the window proc will remove the     * msg for us.     */    if (self->removeMsg) {        PR_LOG(event_lm, PR_LOG_DEBUG,                ("_pl_AcknowledgeNativeNotify: self=%p", self));#ifdef XP_OS2        WinPeekMsg((HAB)0, &aMsg, self->eventReceiverWindow,                   _pr_PostEventMsgId, _pr_PostEventMsgId, PM_REMOVE);#else        PeekMessage(&aMsg, self->eventReceiverWindow,                _pr_PostEventMsgId, _pr_PostEventMsgId, PM_REMOVE);        if (self->timerSet) {          KillTimer(self->eventReceiverWindow, TIMER_ID);          self->timerSet = PR_FALSE;        }#endif    }    return PR_SUCCESS;#elif defined(VMS)    PR_LOG(event_lm, PR_LOG_DEBUG,            ("_pl_AcknowledgeNativeNotify: self=%p efn=%d",             self, self->efn));    /*    ** If this is the last entry, then clear the event flag. Also make sure    ** the flag is cleared on any spurious wakeups.    */    sys$clref(self->efn);    return PR_SUCCESS;#elif defined(XP_UNIX) && !defined(XP_MACOSX)    PRInt32 count;    unsigned char c;    PR_LOG(event_lm, PR_LOG_DEBUG,            ("_pl_AcknowledgeNativeNotify: self=%p",             self));	/* consume the byte NativeNotify put in our pipe: */    count = read(self->eventPipe[0], &c, 1);	if ((count == 1) && (c == NOTIFY_TOKEN)) {		return PR_SUCCESS;	} else if ((count == -1) && ((errno == EAGAIN) || (errno == EWOULDBLOCK))) {		return PR_SUCCESS;	} else		return PR_FAILURE;#else#if defined(XP_MAC)#pragma unused (self)#endif    /* nothing to do on the other platforms */    return PR_SUCCESS;#endif}