Skip to content

Commit 9a2e05a

Browse files
authored
Fix Building on Haiku OS (#428)
1 parent 195a451 commit 9a2e05a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/engine/execunix.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,16 @@ void exec_wait()
537537
close_streams( i, ERR );
538538

539539
/* Reap the child and release resources. */
540+
#ifdef __HAIKU__
541+
while ((pid = waitpid(cmdtab[i].pid, &status, 0)) == -1)
542+
if (errno != EINTR)
543+
break;
544+
getrusage(RUSAGE_CHILDREN, &cmd_usage);
545+
#else
540546
while ( ( pid = wait4( cmdtab[ i ].pid, &status, 0, &cmd_usage ) ) == -1 )
541547
if ( errno != EINTR )
542548
break;
549+
#endif
543550
if ( pid != cmdtab[ i ].pid )
544551
{
545552
err_printf( "unknown pid %d with errno = %d\n", pid, errno );

0 commit comments

Comments
 (0)