summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2001-04-29 18:12:37 +0000
committermillert <millert@openbsd.org>2001-04-29 18:12:37 +0000
commit6da0f682c4ca3394a346baf5bb7a8cfe5f36dfc9 (patch)
tree34308c90f749431bf453c822f5f9f5782b788674
parentsync (diff)
downloadwireguard-openbsd-6da0f682c4ca3394a346baf5bb7a8cfe5f36dfc9.tar.xz
wireguard-openbsd-6da0f682c4ca3394a346baf5bb7a8cfe5f36dfc9.zip
If errmsg() is passed a negative argument return strerror(errno)
Noticed while diffing against NetBSD version
-rw-r--r--usr.bin/sup/src/errmsg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sup/src/errmsg.c b/usr.bin/sup/src/errmsg.c
index b8de4d0836a..fff4ca0bda9 100644
--- a/usr.bin/sup/src/errmsg.c
+++ b/usr.bin/sup/src/errmsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: errmsg.c,v 1.4 1997/09/16 11:01:15 deraadt Exp $ */
+/* $OpenBSD: errmsg.c,v 1.5 2001/04/29 18:12:37 millert Exp $ */
/*
* Copyright (c) 1991 Carnegie Mellon University
@@ -71,6 +71,6 @@ int cod;
return(unk);
#else
- return strerror(cod);
+ return strerror(cod < 0 ? errno : cod);
#endif
}