File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -137,20 +137,19 @@ static void keepalive(void (*work)(void *data), void *data)
137137 /* enable signalling in kill_child_handler */
138138 child_pid = p ;
139139
140- p1 = waitpid (p , & status , 0 );
140+ // wait for child to finish and check status
141+ while ((p1 = waitpid (p , & status , 0 ) == (pid_t ) (-1 )) && errno == EINTR )
142+ ;
143+
144+ if (p1 == (pid_t ) (-1 ))
145+ {
146+ yaz_log (YLOG_FATAL |YLOG_ERRNO , "waitpid" );
147+ break ;
148+ }
141149
142150 /* disable signalling in kill_child_handler */
143151 child_pid = 0 ;
144152
145- if (p1 == (pid_t )(-1 ))
146- {
147- if (errno != EINTR )
148- {
149- yaz_log (YLOG_FATAL |YLOG_ERRNO , "waitpid" );
150- break ;
151- }
152- continue ;
153- }
154153 if (p1 != p )
155154 {
156155 yaz_log (YLOG_FATAL , "p1=%d != p=%d" , p1 , p );
You can’t perform that action at this time.
0 commit comments