summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@markovcorp.com>2018-01-25 14:35:07 -0800
committerOri Bernstein <ori@markovcorp.com>2018-01-25 14:35:07 -0800
commit0b3e6b3218f6cbcd0157265bfcf01df880a88ee7 (patch)
tree5a38e2796c86899d6caf424edc836e8805f327b1
parentf1c2aa0d83a485ac3506d007263631a0e338da4d (diff)
downloadmc-0b3e6b3218f6cbcd0157265bfcf01df880a88ee7.tar.gz
Don't print when exec fails.
-rw-r--r--lib/std/spork.myr4
-rw-r--r--lib/std/syswrap+plan9.myr2
-rw-r--r--lib/std/syswrap+posixy.myr2
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/spork.myr b/lib/std/spork.myr
index e2baf48..392ecc6 100644
--- a/lib/std/spork.myr
+++ b/lib/std/spork.myr
@@ -22,7 +22,7 @@ const run = {cmd
-> `Waiterror
elif pid == 0
execvp(cmd[0], cmd)
- die("failed exec\n")
+ suicide()
else
-> wait(pid)
;;
@@ -152,7 +152,7 @@ const sporkfd = {cmd, infds, outfds, errfds
execvp(cmd[0], cmd)
/* if fork succeeds, we never return */
- die("exec failed")
+ suicide()
/* parent */
else
-> `Ok pid
diff --git a/lib/std/syswrap+plan9.myr b/lib/std/syswrap+plan9.myr
index 474c5cd..7ca9c3c 100644
--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -65,7 +65,7 @@ pkg std =
/* 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)
diff --git a/lib/std/syswrap+posixy.myr b/lib/std/syswrap+posixy.myr
index 4dd97fd..d0c63c8 100644
--- a/lib/std/syswrap+posixy.myr
+++ b/lib/std/syswrap+posixy.myr
@@ -64,7 +64,7 @@ pkg std =
/* 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)