summaryrefslogtreecommitdiff
path: root/sys/src/ape/lib/fmt
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-05-04 00:23:48 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-05-04 00:23:48 +0200
commit14685d65958bed4d68b9c60564fa8d09aa746462 (patch)
treef2480af19061f27c67a36a2bb8fd7f41d047732a /sys/src/ape/lib/fmt
parent7657312dcf5b9435ff848b20dfc3a0546ab8a500 (diff)
ape: return plan9 error strings from strerror()
when _syserrno() fails to map a plan9 error string to a unix error number, we copy the plan9 error string to the per process error buffer "plan9err" and set errno = EPLAN9. when strerror() is called with EPLAN9, it returns a pointer to the plan9err buffer.
Diffstat (limited to 'sys/src/ape/lib/fmt')
-rw-r--r--sys/src/ape/lib/fmt/werrstr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/ape/lib/fmt/werrstr.c b/sys/src/ape/lib/fmt/werrstr.c
index 05222f72e..01a9ec4b2 100644
--- a/sys/src/ape/lib/fmt/werrstr.c
+++ b/sys/src/ape/lib/fmt/werrstr.c
@@ -2,7 +2,7 @@
#include <errno.h>
#include "fmt.h"
-extern char _plan9err[128];
+extern char *_plan9err;
void
werrstr(const char *fmt, ...)
@@ -10,7 +10,7 @@ werrstr(const char *fmt, ...)
va_list arg;
va_start(arg, fmt);
- snprint(_plan9err, sizeof _plan9err, fmt, arg);
+ snprint(_plan9err, 128, fmt, arg);
va_end(arg);
errno = EPLAN9;
}