summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'libstd')
-rw-r--r--libstd/fmt.myr12
-rw-r--r--libstd/optparse.myr2
-rw-r--r--libstd/spork.myr6
-rw-r--r--libstd/try.myr2
4 files changed, 11 insertions, 11 deletions
diff --git a/libstd/fmt.myr b/libstd/fmt.myr
index 9092cd1..bb2cf91 100644
--- a/libstd/fmt.myr
+++ b/libstd/fmt.myr
@@ -37,8 +37,8 @@ pkg std =
const bfmt : (buf : byte[:], fmt : byte[:], args : ... -> byte[:])
const bfmtv : (buf : byte[:], fmt : byte[:], ap : valist -> byte[:])
- $noret const fatal : (status : int, fmt : byte[:], args : ... -> void)
- $noret const fatalv : (status : int, fmt : byte[:], ap : valist -> void)
+ $noret const fatal : (fmt : byte[:], args : ... -> void)
+ $noret const fatalv : (fmt : byte[:], ap : valist -> void)
;;
/* Writes a string of text up to 2 kb in size to stdout */
@@ -63,15 +63,15 @@ const fputv = {fd, fmt, ap
}
/* same as 'put', but exits the program after printing */
-const fatal = {status, fmt, args
+const fatal = {fmt, args
putv(fmt, vastart(&args))
- exit(status)
+ exit(1)
}
/* same as 'putv', but exits the program after printing */
-const fatalv = {status, fmt, ap
+const fatalv = {fmt, ap
putv(fmt, ap)
- exit(status)
+ exit(1)
}
/* formats a string, allocating the slice. FIXME: calculate the
diff --git a/libstd/optparse.myr b/libstd/optparse.myr
index a043263..4f454b5 100644
--- a/libstd/optparse.myr
+++ b/libstd/optparse.myr
@@ -97,7 +97,7 @@ const optnext = {ctx
optusage(ctx.optargs[0], ctx.optdef)
exit(0)
else
- fatal(1, "unexpected argument '%c'\n", c)
+ fatal("unexpected argument '%c'\n", c)
;;
| `Some (true, needed):
/* -arg => '-a' 'rg' */
diff --git a/libstd/spork.myr b/libstd/spork.myr
index 1778037..f728768 100644
--- a/libstd/spork.myr
+++ b/libstd/spork.myr
@@ -45,15 +45,15 @@ const sporkfd = {cmd, infd, outfd
elif pid == 0
/* stdin/stdout for our communication. */
if dup2(infd castto(fd), 0) != 0
- fatal(1, "unable to set stdin\n")
+ fatal("unable to set stdin\n")
;;
if dup2(outfd castto(fd), 1) != 1
- fatal(1, "unable to set stdout\n")
+ fatal("unable to set stdout\n")
;;
close(infd)
close(outfd)
execvp(cmd[0], cmd) < 0
- fatal(1, "failed to exec %s\n")
+ fatal("failed to exec %s\n")
/* parent */
else
-> `Ok pid
diff --git a/libstd/try.myr b/libstd/try.myr
index 1539a98..2997143 100644
--- a/libstd/try.myr
+++ b/libstd/try.myr
@@ -8,6 +8,6 @@ pkg std =
generic try = {v
match v
| `Some x: -> x
- | `None: fatal(1, "expected `Some @a, got `None\n")
+ | `None: fatal("expected `Some @a, got `None\n")
;;
}