diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-10-19 16:26:17 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-10-19 16:26:17 +0000 |
commit | 5fc2a970b60b1a41734ce64c6aaaf8536ded6e80 (patch) | |
tree | 676a7f68b2a1376d06b401ef94dee82642b1bf00 /lib | |
parent | c01fac85eee4d5c7acf3a4d0f95c15cb0c78ba6b (diff) |
Remove the save_errno dance inside strerror_r(3). It is from the
time when we had national language support.
OK millert@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/string/strerror_r.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libc/string/strerror_r.c b/lib/libc/string/strerror_r.c index 53f5d6bda40..b45dee12d8a 100644 --- a/lib/libc/string/strerror_r.c +++ b/lib/libc/string/strerror_r.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strerror_r.c,v 1.12 2015/10/25 10:22:09 bluhm Exp $ */ +/* $OpenBSD: strerror_r.c,v 1.13 2016/10/19 16:26:16 bluhm Exp $ */ /* Public Domain <marc@snafu.org> */ #include <errno.h> @@ -85,15 +85,13 @@ __num2string(int num, int sign, int setid, char *buf, size_t buflen, int strerror_r(int errnum, char *strerrbuf, size_t buflen) { - int save_errno; int ret_errno; - save_errno = errno; - ret_errno = __num2string(errnum, 1, 1, strerrbuf, buflen, sys_errlist, sys_nerr, UPREFIX); - errno = ret_errno ? ret_errno : save_errno; + if (ret_errno) + errno = ret_errno; return (ret_errno); } DEF_WEAK(strerror_r); |