os.execShellCmd: use WEXITSTATUS to retrieve exit code (#10222)
According to POSIX, system() shall returns the termination status in the format specified by waitpid(), which means WEXITSTATUS should be used to retrieve the exit code portably. This fixes execShellCmd on Haiku.
This commit is contained in:
parent
87f8ec5b92
commit
139fa396e8
1 changed files with 1 additions and 1 deletions
|
|
@ -1298,7 +1298,7 @@ proc execShellCmd*(command: string): int {.rtl, extern: "nos$1",
|
|||
## shell involved, use the `execProcess` proc of the `osproc`
|
||||
## module.
|
||||
when defined(posix):
|
||||
result = c_system(command) shr 8
|
||||
result = WEXITSTATUS(c_system(command))
|
||||
else:
|
||||
result = c_system(command)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue