fd[0] = fd[1] = NULL;
PR_IMPLEMENT(PRFileDesc *) PR_NewPollableEvent(void){    PRFileDesc *event;    PRFileDesc *fd[2]; /* fd[0] is the read end; fd[1] is the write end */    fd[0] = fd[1] = NULL;    if (PR_CallOnce(&_pr_polevt_once_control, _pr_PolEvtInit) == PR_FAILURE) {        return NULL;    }    event = PR_CreateIOLayerStub(_pr_polevt_id, &_pr_polevt_methods);    if (NULL == event) {        goto errorExit;    }     event->secret = PR_NEW(PRFilePrivate);    if (event->secret == NULL) {        PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);        goto errorExit;    }#ifndef USE_TCP_SOCKETPAIR    if (PR_CreatePipe(&fd[0], &fd[1]) == PR_FAILURE) {        goto errorExit;    }#else    if (PR_NewTCPSocketPair(fd) == PR_FAILURE) {        goto errorExit;    }#endif    event->secret->writeEnd = fd[1];    if (PR_PushIOLayer(fd[0], PR_TOP_IO_LAYER, event) == PR_FAILURE) {        goto errorExit;    }    return fd[0];errorExit:    if (fd[0]) {        PR_Close(fd[0]);        PR_Close(fd[1]);    }    if (event) {        PR_DELETE(event->secret);        event->dtor(event);    }    return NULL;}