mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-24 11:55:10 +00:00
new osproc implementation may work with mac os x
This commit is contained in:
@@ -1720,7 +1720,13 @@ when hasSpawnh:
|
||||
POSIX_SPAWN_SETSCHEDULER* {.importc, header: "<spawn.h>".}: cint
|
||||
POSIX_SPAWN_SETSIGDEF* {.importc, header: "<spawn.h>".}: cint
|
||||
POSIX_SPAWN_SETSIGMASK* {.importc, header: "<spawn.h>".}: cint
|
||||
POSIX_SPAWN_USEVFORK* {.importc, header: "<spawn.h>".}: cint
|
||||
|
||||
when defined(macosx):
|
||||
# macosx lacks this, so we define the constant to be 0 to not affect
|
||||
# OR'ing of flags:
|
||||
const POSIX_SPAWN_USEVFORK* = cint(0)
|
||||
else:
|
||||
var POSIX_SPAWN_USEVFORK* {.importc, header: "<spawn.h>".}: cint
|
||||
|
||||
when hasAioH:
|
||||
proc aio_cancel*(a1: cint, a2: ptr Taiocb): cint {.importc, header: "<aio.h>".}
|
||||
|
||||
@@ -547,10 +547,6 @@ elif not defined(useNimRtl):
|
||||
var a = toCStringArray(["sh", "-c"], [x])
|
||||
chck posix_spawn(pid, "/bin/sh", fops, attr, a, e)
|
||||
|
||||
if {poEchoCmd, poUseShell} * options == {poEchoCmd}:
|
||||
# shell echos already, so ...
|
||||
echo(command, " ", join(args, " "))
|
||||
|
||||
chck posix_spawn_file_actions_destroy(fops)
|
||||
chck posix_spawnattr_destroy(attr)
|
||||
|
||||
@@ -593,7 +589,6 @@ elif not defined(useNimRtl):
|
||||
quit("execve call failed: " & $strerror(errno))
|
||||
# Parent process. Copy process information.
|
||||
if poEchoCmd in options:
|
||||
# shell with no redirects echos already, so ...
|
||||
echo(command, " ", join(args, " "))
|
||||
result.id = pid
|
||||
|
||||
|
||||
Reference in New Issue
Block a user