]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Base errc() and warnc() on vwarnc() and verrc() respectively
authorGuillem Jover <guillem@hadrons.org>
Sat, 31 Dec 2011 05:01:27 +0000 (06:01 +0100)
committerGuillem Jover <guillem@hadrons.org>
Tue, 29 May 2012 02:36:23 +0000 (04:36 +0200)
src/err.c

index e5c604d85ae9122268827306816d1b6a8bec3d21..4e505105bb5b88cdc8e13b0cdc60cabe131f3526 100644 (file)
--- a/src/err.c
+++ b/src/err.c
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2006 Robert Millan
+ * Copyright © 2011 Guillem Jover <guillem@hadrons.org>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 void
 warnc(int code, const char *format, ...)
 {
-       int tmp = errno;
        va_list ap;
 
        va_start(ap, format);
-
-       errno = code;
-       warn(format, ap);
-       errno = tmp;
-
+       vwarnc(code, format, ap);
        va_end(ap);
 }
 
@@ -59,10 +55,7 @@ errc(int status, int code, const char *format, ...)
        va_list ap;
 
        va_start(ap, format);
-
-       errno = code;
-       err(status, format, ap);
-
+       verrc(status, code, format, ap);
        va_end(ap);
 }