summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-11 19:59:08 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-11 19:59:08 +0000
commita8a02c3665de209f4c02c3f4e0e382eaf75ac327 (patch)
treea1a7c98291634768dacf9cb4777b642832b61974 /usr.sbin
parent8223a5ee06b199adfe42ffb2f13abfb8cdb36ab6 (diff)
use STDERR_FILENO; ok cloder
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/dhcpd/errwarn.c20
-rw-r--r--usr.sbin/dhcrelay/errwarn.c18
-rw-r--r--usr.sbin/rtadvd/advcap.c10
3 files changed, 24 insertions, 24 deletions
diff --git a/usr.sbin/dhcpd/errwarn.c b/usr.sbin/dhcpd/errwarn.c
index 36d4566b466..a76d074a46e 100644
--- a/usr.sbin/dhcpd/errwarn.c
+++ b/usr.sbin/dhcpd/errwarn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: errwarn.c,v 1.4 2005/04/11 18:59:45 deraadt Exp $ */
+/* $OpenBSD: errwarn.c,v 1.5 2005/04/11 19:59:07 deraadt Exp $ */
/* Errors and warnings... */
@@ -70,8 +70,8 @@ error(char *fmt, ...)
/* Also log it to stderr? */
if (log_perror) {
- write(2, mbuf, strlen(mbuf));
- write(2, "\n", 1);
+ write(STDERR_FILENO, mbuf, strlen(mbuf));
+ write(STDERR_FILENO, "\n", 1);
} else
syslog(log_priority | LOG_ERR, "%s", mbuf);
@@ -99,8 +99,8 @@ warning(char *fmt, ...)
va_end(list);
if (log_perror) {
- write(2, mbuf, strlen(mbuf));
- write(2, "\n", 1);
+ write(STDERR_FILENO, mbuf, strlen(mbuf));
+ write(STDERR_FILENO, "\n", 1);
} else
syslog(log_priority | LOG_ERR, "%s", mbuf);
@@ -122,8 +122,8 @@ note(char *fmt, ...)
va_end(list);
if (log_perror) {
- write(2, mbuf, strlen(mbuf));
- write(2, "\n", 1);
+ write(STDERR_FILENO, mbuf, strlen(mbuf));
+ write(STDERR_FILENO, "\n", 1);
} else
syslog(log_priority | LOG_INFO, "%s", mbuf);
@@ -145,8 +145,8 @@ debug(char *fmt, ...)
va_end(list);
if (log_perror) {
- write(2, mbuf, strlen(mbuf));
- write(2, "\n", 1);
+ write(STDERR_FILENO, mbuf, strlen(mbuf));
+ write(STDERR_FILENO, "\n", 1);
} else
syslog(log_priority | LOG_DEBUG, "%s", mbuf);
@@ -217,7 +217,7 @@ parse_warn(char *fmt, ...)
iov[4].iov_len = lexchar - 1;
iov[5].iov_base = "^\n";
iov[5].iov_len = 2;
- writev(2, iov, sizeof(iov)/sizeof(iov[0]));
+ writev(STDERR_FILENO, iov, sizeof(iov)/sizeof(iov[0]));
} else {
syslog(log_priority | LOG_ERR, "%s", mbuf);
syslog(log_priority | LOG_ERR, "%s", token_line);
diff --git a/usr.sbin/dhcrelay/errwarn.c b/usr.sbin/dhcrelay/errwarn.c
index 3eadcf79ce5..85658ef2435 100644
--- a/usr.sbin/dhcrelay/errwarn.c
+++ b/usr.sbin/dhcrelay/errwarn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: errwarn.c,v 1.2 2004/05/04 21:23:10 deraadt Exp $ */
+/* $OpenBSD: errwarn.c,v 1.3 2005/04/11 19:59:07 deraadt Exp $ */
/* Errors and warnings... */
@@ -69,8 +69,8 @@ error(char *fmt, ...)
/* Also log it to stderr? */
if (log_perror) {
- write(2, mbuf, strlen(mbuf));
- write(2, "\n", 1);
+ write(STDERR_FILENO, mbuf, strlen(mbuf));
+ write(STDERR_FILENO, "\n", 1);
}
syslog(LOG_CRIT, "exiting.");
@@ -100,8 +100,8 @@ warn(char *fmt, ...)
#endif
if (log_perror) {
- write(2, mbuf, strlen(mbuf));
- write(2, "\n", 1);
+ write(STDERR_FILENO, mbuf, strlen(mbuf));
+ write(STDERR_FILENO, "\n", 1);
}
return (0);
@@ -126,8 +126,8 @@ note(char *fmt, ...)
#endif
if (log_perror) {
- write(2, mbuf, strlen(mbuf));
- write(2, "\n", 1);
+ write(STDERR_FILENO, mbuf, strlen(mbuf));
+ write(STDERR_FILENO, "\n", 1);
}
return (0);
@@ -152,8 +152,8 @@ debug(char *fmt, ...)
#endif
if (log_perror) {
- write(2, mbuf, strlen(mbuf));
- write(2, "\n", 1);
+ write(STDERR_FILENO, mbuf, strlen(mbuf));
+ write(STDERR_FILENO, "\n", 1);
}
return (0);
diff --git a/usr.sbin/rtadvd/advcap.c b/usr.sbin/rtadvd/advcap.c
index 2386ae92742..ffa433ec0aa 100644
--- a/usr.sbin/rtadvd/advcap.c
+++ b/usr.sbin/rtadvd/advcap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: advcap.c,v 1.10 2003/06/02 23:36:54 millert Exp $ */
+/* $OpenBSD: advcap.c,v 1.11 2005/04/11 19:59:07 deraadt Exp $ */
/* $KAME: advcap.c,v 1.9 2002/05/29 14:28:35 itojun Exp $ */
/*
@@ -158,7 +158,7 @@ getent(bp, name, cp)
break;
}
if (cp >= bp + BUFSIZ) {
- write(2,"Remcap entry too long\n", 23);
+ write(STDERR_FILENO, "Remcap entry too long\n", 23);
break;
} else
*cp++ = c;
@@ -194,7 +194,7 @@ tnchktc()
p = tbuf + strlen(tbuf) - 2; /* before the last colon */
while (*--p != ':')
if (p < tbuf) {
- write(2, "Bad remcap entry\n", 18);
+ write(STDERR_FILENO, "Bad remcap entry\n", 18);
return (0);
}
p++;
@@ -207,7 +207,7 @@ tnchktc()
q++;
*q = 0;
if (++hopcount > MAXHOP) {
- write(2, "Infinite tc= loop\n", 18);
+ write(STDERR_FILENO, "Infinite tc= loop\n", 18);
return (0);
}
if (getent(tcbuf, tcname, remotefile) != 1) {
@@ -217,7 +217,7 @@ tnchktc()
;
l = p - holdtbuf + strlen(q);
if (l > BUFSIZ) {
- write(2, "Remcap entry too long\n", 23);
+ write(STDERR_FILENO, "Remcap entry too long\n", 23);
q[BUFSIZ - (p-holdtbuf)] = 0;
}
strlcpy(p, q, holdtbuf + BUFSIZ - p);