From: Hallvard Furuseth Date: Thu, 26 Mar 2009 22:12:12 +0000 (+0000) Subject: ITS#6037: don't loop forever on EINTR in wait4child() X-Git-Tag: ACLCHECK_0~654 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3e57c96acd653c71c595b5bcfc8960162c11ac18;p=openldap ITS#6037: don't loop forever on EINTR in wait4child() --- diff --git a/servers/slapd/main.c b/servers/slapd/main.c index fa008ee2cf..b22e8b70f1 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -1056,13 +1056,12 @@ wait4child( int sig ) int save_errno = errno; #ifdef WNOHANG - errno = 0; + do + errno = 0; #ifdef HAVE_WAITPID - while ( waitpid( (pid_t)-1, NULL, WNOHANG ) > 0 || errno == EINTR ) - ; /* NULL */ + while ( waitpid( (pid_t)-1, NULL, WNOHANG ) > 0 || errno == EINTR ); #else - while ( wait3( NULL, WNOHANG, NULL ) > 0 || errno == EINTR ) - ; /* NULL */ + while ( wait3( NULL, WNOHANG, NULL ) > 0 || errno == EINTR ); #endif #else (void) wait( NULL ); @@ -1072,4 +1071,3 @@ wait4child( int sig ) } #endif /* LDAP_SIGCHLD */ -