ref: 0b3e6b3218f6cbcd0157265bfcf01df880a88ee7
parent: f1c2aa0d83a485ac3506d007263631a0e338da4d
author: Ori Bernstein <ori@markovcorp.com>
date: Thu Jan 25 09:35:07 EST 2018
Don't print when exec fails.
--- a/lib/std/spork.myr
+++ b/lib/std/spork.myr
@@ -22,7 +22,7 @@
-> `Waiterror
elif pid == 0
execvp(cmd[0], cmd)
- die("failed exec\n")
+ suicide()
else
-> wait(pid)
;;
@@ -152,7 +152,7 @@
execvp(cmd[0], cmd)
/* if fork succeeds, we never return */
- die("exec failed")
+ suicide()
/* parent */
else
-> `Ok pid
--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -65,7 +65,7 @@
/* process stuff */
const getpid : ( -> pid)
- const suicide : ( -> void)
+ $noret const suicide : ( -> void)
const fork : (-> pid)
const execv : (cmd : byte[:], args : byte[:][:] -> errno)
const execve : (cmd : byte[:], args : byte[:][:], env : byte[:][:] -> errno)
--- a/lib/std/syswrap+posixy.myr
+++ b/lib/std/syswrap+posixy.myr
@@ -64,7 +64,7 @@
/* process stuff */
const getpid : ( -> pid)
- const suicide : ( -> void)
+ $noret const suicide : ( -> void)
const fork : (-> pid)
const execv : (cmd : byte[:], args : byte[:][:] -> errno)
const execve : (cmd : byte[:], args : byte[:][:], env : byte[:][:] -> errno)