Skip to content

Commit

Permalink
Log an info message instead of error if waitpid returns ECHILD.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstone2001 committed Oct 1, 2023
1 parent 7727359 commit 0aa6842
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions common/os_calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -3381,17 +3381,24 @@ g_waitpid(int pid, int *stat_loc, int options)
#else
int rv = 0;

again:
rv = waitpid(pid, stat_loc, options);
//retry EINTR.
if( rv == -1 && errno == EINTR )
{
goto again;
}
again:
rv = waitpid(pid, stat_loc, options);
//retry EINTR.
if( rv == -1 && errno == EINTR )
{
goto again;
}

if( rv == -1 )
{
LOG(LOG_LEVEL_ERROR, "waitpid returned %s", g_get_strerror());
if( errno == ECHILD )
{
LOG(LOG_LEVEL_INFO, "waitpid returned %s", g_get_strerror());
}
else
{
LOG(LOG_LEVEL_ERROR, "waitpid returned %s", g_get_strerror());
}
}

return rv;
Expand Down

0 comments on commit 0aa6842

Please sign in to comment.