From bd5a8416229173ab299dba20323d2cbbea215914 Mon Sep 17 00:00:00 2001 From: fasxmut Date: Thu, 5 Dec 2024 15:17:55 +0800 Subject: [PATCH] Fix Building on Haiku OS --- src/engine/execunix.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/engine/execunix.cpp b/src/engine/execunix.cpp index fd8220e779..5aea799eb5 100644 --- a/src/engine/execunix.cpp +++ b/src/engine/execunix.cpp @@ -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 );