mcstrans: continue on failed accept() or add_pollfd() calls
Stephen Smalley
maintainerPATCH 1/1 mcstrans: continue on failed accept() or add_pollfd() calls
Don't exit on failed accept() or add_pollfd() calls and close the fd if we couldn't add it to the poll set.
Signed-off-by Stephen Smalley <[email protected]>
--- mcstrans/src/mcstransd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
mcstrans/src/mcstransd.c +3 -2
@@ -307,14 +307,15 @@ process_events(struct pollfd **ufds, int *nfds)/* Probably received a connection */ if ((connfd =accept (sockfd,NULL ,NULL )) <0 ) {syslog (LOG_ERR ,"accept() failed: %m" ); -return -1 ; +continue ; }if (add_pollfd (ufds, nfds, connfd)) {syslog (LOG_ERR ,"Failed to add fd (%d) to poll list\n" , connfd); -return -1 ; +close (connfd); +continue ; } }else { ret =service_request (connfd);
Signature · 1 line
2.54.0
Stephen Smalley
maintainerQuoted 5 lines · Stephen Smalley
Don't exit on failed
accept()oradd_pollfd()calls and close the fd if we couldn't add it to the poll set.Signed-off-by Stephen Smalley <[email protected]>
Merged.
Quoted 29 lines
--- mcstrans/src/mcstransd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)mcstrans/src/mcstransd.c +3
-3@@ -307,14 +307,15 @@ process_events(struct pollfd **ufds, int *nfds)/* Probably received a connection */ if ((connfd =accept (sockfd,NULL ,NULL )) <0 ) {syslog (LOG_ERR ,"accept() failed: %m" ); -return -1 ; +continue ; }if (add_pollfd (ufds, nfds, connfd)) {syslog (LOG_ERR ,"Failed to add fd (%d) to poll list\n" , connfd); -return -1 ; +close (connfd); +continue ; } }else { ret =service_request (connfd); --2.54.0