Skip to content

Commit

Permalink
Fix Building on Haiku OS
Browse files Browse the repository at this point in the history
  • Loading branch information
fasxmut committed Dec 5, 2024
1 parent 7954ee6 commit bd5a841
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/engine/execunix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,16 @@ void exec_wait()
close_streams( i, ERR );

/* Reap the child and release resources. */
#ifdef __HAIKU__
while ((pid = waitpid(cmdtab[i].pid, &status, 0)) == -1)
if (errno != EINTR)
break;
getrusage(RUSAGE_CHILDREN, &cmd_usage);
#else
while ( ( pid = wait4( cmdtab[ i ].pid, &status, 0, &cmd_usage ) ) == -1 )
if ( errno != EINTR )
break;
#endif
if ( pid != cmdtab[ i ].pid )
{
err_printf( "unknown pid %d with errno = %d\n", pid, errno );
Expand Down

0 comments on commit bd5a841

Please sign in to comment.