File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ xsetfd(int fd, int flags)
473473 if (oflags == -1 )
474474 return -1 ;
475475 if (!(oflags & FD_CLOEXEC ) &&
476- fcntl (fd , F_SETFD , oflags | O_NONBLOCK ) == -1 )
476+ fcntl (fd , F_SETFD , oflags | FD_CLOEXEC ) == -1 )
477477 return -1 ;
478478 }
479479#endif
Original file line number Diff line number Diff line change @@ -700,7 +700,11 @@ eloop_forked(struct eloop *eloop, unsigned short flags)
700700 unsigned short events ;
701701 int err ;
702702
703- /* The fd is invalid after a fork, no need to close it. */
703+ /* kqueue invalidates the fd on fork.
704+ * epoll shares state across fork, so we close the old and create a new one. */
705+ #ifdef USE_EPOLL
706+ close (eloop -> fd );
707+ #endif
704708 eloop -> fd = -1 ;
705709 if (flags && eloop_open (eloop ) == -1 )
706710 return -1 ;
Original file line number Diff line number Diff line change @@ -102,12 +102,12 @@ srv_recv(struct srv_ctx *sctx, unsigned short e)
102102
103103 nread = recvmsg (sctx -> srv_fd , & msg , MSG_WAITALL );
104104 if (nread == -1 ) {
105- logerr ("%s: recvmsg cmd " , __func__ );
105+ logerr ("%s: recvmsg data " , __func__ );
106106 return -1 ;
107107 }
108108 if ((size_t )nread != cmd .sc_datalen ) {
109- logerrx ("%s: read datalen mismatch: %zd != %zd " ,
110- __func__ , nread , cmd .sc_datalen );
109+ logerrx ("%s: read datalen mismatch: %zu != %zu " ,
110+ __func__ , ( size_t ) nread , cmd .sc_datalen );
111111 return -1 ;
112112 }
113113 }
You can’t perform that action at this time.
0 commit comments