]> granicus.if.org Git - sudo/commitdiff
Add NO_STDERR flag.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 26 Oct 2004 22:20:18 +0000 (22:20 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 26 Oct 2004 22:20:18 +0000 (22:20 +0000)
logging.c
logging.h

index c04f160c2bf4d45ce54d8691b746a34012d1fa01..fb9ff9cf0577d2c3c5b3a099b75486303c6b1780 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -395,10 +395,12 @@ log_error(va_alist)
     /*
      * Tell the user.
      */
-    if (flags & USE_ERRNO)
-       warn("%s", message);
-    else
-       warnx("%s", message);
+    if (!ISSET(flags, NO_STDERR)) {
+       if (flags & USE_ERRNO)
+           warn("%s", message);
+       else
+           warnx("%s", message);
+    }
 
     /*
      * Send a copy of the error via mail.
index 845d392388922f5be907d624c47bf0b941de2427..add20a55d943b597050342160b538d814c87f16f 100644 (file)
--- a/logging.h
+++ b/logging.h
@@ -34,6 +34,7 @@
 #define USE_ERRNO              0x02
 #define NO_MAIL                        0x04
 #define NO_EXIT                        0x08
+#define NO_STDERR              0x10
 
 /*
  * Maximum number of characters to log per entry.  The syslogger