diff options
author | 2016-10-31 02:57:27 +0000 | |
---|---|---|
committer | 2016-10-31 02:57:27 +0000 | |
commit | b7af0f14e18680b78638bf7b1b79386608bfffe7 (patch) | |
tree | 2b9f5e4256923afa74e08151dc19b2be5214f532 | |
parent | turns out these chips can handle buffers up to 9400 bytes in length. (diff) | |
download | wireguard-openbsd-b7af0f14e18680b78638bf7b1b79386608bfffe7.tar.xz wireguard-openbsd-b7af0f14e18680b78638bf7b1b79386608bfffe7.zip |
Pass the errno value to vfatal(), renaming it to vfatalc() to match,
intead of using errno as an implicit argument
ok reyk@
-rw-r--r-- | usr.sbin/vmd/log.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.sbin/vmd/log.c b/usr.sbin/vmd/log.c index e71d2d33160..acfef5ccff3 100644 --- a/usr.sbin/vmd/log.c +++ b/usr.sbin/vmd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.3 2016/10/12 11:47:34 reyk Exp $ */ +/* $OpenBSD: log.c,v 1.4 2016/10/31 02:57:27 guenther Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -165,11 +165,10 @@ log_debug(const char *emsg, ...) } static void -vfatal(const char *emsg, va_list ap) +vfatalc(int code, const char *emsg, va_list ap) { static char s[BUFSIZ]; const char *sep; - int saved_errno = errno; if (emsg != NULL) { (void)vsnprintf(s, sizeof(s), emsg, ap); @@ -178,9 +177,9 @@ vfatal(const char *emsg, va_list ap) s[0] = '\0'; sep = ""; } - if (saved_errno) + if (code) logit(LOG_CRIT, "%s: %s%s%s", - log_procname, s, sep, strerror(saved_errno)); + log_procname, s, sep, strerror(code)); else logit(LOG_CRIT, "%s%s%s", log_procname, sep, s); } @@ -191,7 +190,7 @@ fatal(const char *emsg, ...) va_list ap; va_start(ap, emsg); - vfatal(emsg, ap); + vfatalc(errno, emsg, ap); va_end(ap); exit(1); } @@ -201,9 +200,8 @@ fatalx(const char *emsg, ...) { va_list ap; - errno = 0; va_start(ap, emsg); - vfatal(emsg, ap); + vfatalc(0, emsg, ap); va_end(ap); exit(1); } |