diff options
Diffstat (limited to 'lib/pure/osproc.nim')
-rw-r--r-- | lib/pure/osproc.nim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 44ec5b548..76bd2dfe1 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -841,15 +841,19 @@ elif not defined(useNimRtl): if data.workingDir.len > 0: setCurrentDir($data.workingDir) var pid: Pid + var err: OSErrorCode if data.optionPoUsePath: res = posix_spawnp(pid, data.sysCommand, fops, attr, data.sysArgs, data.sysEnv) + if res != 0'i32: err = osLastError() else: res = posix_spawn(pid, data.sysCommand, fops, attr, data.sysArgs, data.sysEnv) + if res != 0'i32: err = osLastError() discard posix_spawn_file_actions_destroy(fops) discard posix_spawnattr_destroy(attr) - chck res + if res != 0'i32: raiseOSError(err) + return pid else: proc startProcessAuxFork(data: StartProcessData): Pid = |