summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-13 02:33:10 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-13 02:33:10 +0000
commit1aa7b0eba47e9452ea6454af501b33b70e05d060 (patch)
tree046eecb5edae4ab0d192fb5297f35203fc8b44ed /usr.bin
parent8b7d13b0e05b4a89823fc6e4ea4e6043f9540c72 (diff)
use STD{IN,OUT,ERR}_FILENO
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/job.c4
-rw-r--r--usr.bin/mg/ttyio.c4
-rw-r--r--usr.bin/oldrdist/server.c10
-rw-r--r--usr.bin/talk/io.c6
-rw-r--r--usr.bin/top/display.c4
-rw-r--r--usr.bin/top/top.c8
-rw-r--r--usr.bin/window/wwrint.c6
7 files changed, 21 insertions, 21 deletions
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index 469000e97ee..0697b3466e4 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: job.c,v 1.58 2004/11/29 06:20:03 jsg Exp $ */
+/* $OpenBSD: job.c,v 1.59 2005/04/13 02:33:08 deraadt Exp $ */
/* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */
/*
@@ -1336,7 +1336,7 @@ JobExec(Job *job, char **argv)
(void)execv(shellPath, argv);
- (void)write(2, "Could not execute shell\n",
+ (void)write(STDERR_FILENO, "Could not execute shell\n",
sizeof("Could not execute shell"));
_exit(1);
} else {
diff --git a/usr.bin/mg/ttyio.c b/usr.bin/mg/ttyio.c
index 2858f1c99d4..782ac22bda4 100644
--- a/usr.bin/mg/ttyio.c
+++ b/usr.bin/mg/ttyio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttyio.c,v 1.26 2005/04/03 02:09:28 db Exp $ */
+/* $OpenBSD: ttyio.c,v 1.27 2005/04/13 02:33:08 deraadt Exp $ */
/*
* POSIX terminal I/O.
@@ -162,7 +162,7 @@ ttgetc(void)
int ret;
do {
- ret = read(0, &c, 1);
+ ret = read(STDIN_FILENO, &c, 1);
if (ret == -1 && errno == EINTR) {
if (winch_flag) {
refresh(0, 0);
diff --git a/usr.bin/oldrdist/server.c b/usr.bin/oldrdist/server.c
index ff68cc4343d..db1c6d6a7aa 100644
--- a/usr.bin/oldrdist/server.c
+++ b/usr.bin/oldrdist/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.27 2004/10/04 05:21:27 jsg Exp $ */
+/* $OpenBSD: server.c,v 1.28 2005/04/13 02:33:08 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -31,7 +31,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)server.c 8.1 (Berkeley) 6/9/93"; */
-static char *rcsid = "$OpenBSD: server.c,v 1.27 2004/10/04 05:21:27 jsg Exp $";
+static char *rcsid = "$OpenBSD: server.c,v 1.28 2005/04/13 02:33:08 deraadt Exp $";
#endif /* not lint */
#include <sys/wait.h>
@@ -632,7 +632,7 @@ again:
if (*s != '\n') {
if (!iamremote) {
fflush(stdout);
- (void) write(2, s, cp - s);
+ (void) write(STDERR_FILENO, s, cp - s);
}
if (lfp != NULL)
(void) fwrite(s, 1, cp - s, lfp);
@@ -1198,7 +1198,7 @@ rmchk(opts)
if (*s != '\n') {
if (!iamremote) {
fflush(stdout);
- (void) write(2, s, cp - s);
+ (void) write(STDERR_FILENO, s, cp - s);
}
if (lfp != NULL)
(void) fwrite(s, 1, cp - s, lfp);
@@ -1547,7 +1547,7 @@ response()
if (*s != '\n') {
if (!iamremote) {
fflush(stdout);
- (void) write(2, s, cp - s);
+ (void) write(STDERR_FILENO, s, cp - s);
}
if (lfp != NULL)
(void) fwrite(s, 1, cp - s, lfp);
diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c
index f23558222e7..eb58b8f6eab 100644
--- a/usr.bin/talk/io.c
+++ b/usr.bin/talk/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.15 2004/03/02 21:04:42 tedu Exp $ */
+/* $OpenBSD: io.c,v 1.16 2005/04/13 02:33:08 deraadt Exp $ */
/* $NetBSD: io.c,v 1.4 1994/12/09 02:14:20 jtc Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: io.c,v 1.15 2004/03/02 21:04:42 tedu Exp $";
+static const char rcsid[] = "$OpenBSD: io.c,v 1.16 2005/04/13 02:33:08 deraadt Exp $";
#endif /* not lint */
/*
@@ -109,7 +109,7 @@ talk(void)
* curses's output routines would screw up
*/
ioctl(0, FIONREAD, &nb);
- nb = read(0, buf, nb);
+ nb = read(STDIN_FILENO, buf, nb);
display(&my_win, buf, nb);
/* might lose data here because sockt is non-blocking */
write(sockt, buf, nb);
diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c
index 243fdc6af4f..f5d1e289c77 100644
--- a/usr.bin/top/display.c
+++ b/usr.bin/top/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.18 2004/06/13 18:49:02 otto Exp $ */
+/* $OpenBSD: display.c,v 1.19 2005/04/13 02:33:09 deraadt Exp $ */
/*
* Top users/processes display for Unix
@@ -764,7 +764,7 @@ readline(char *buffer, int size, int numeric)
size -= 1;
/* read loop */
- while ((fflush(stdout), (len = read(0, ptr, 1)) > 0)) {
+ while ((fflush(stdout), (len = read(STDIN_FILENO, ptr, 1)) > 0)) {
if (len == 0 || leaveflag) {
end_screen();
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index b53d0e1cda5..54d2ecbe36c 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.c,v 1.35 2004/10/07 06:26:12 otto Exp $ */
+/* $OpenBSD: top.c,v 1.36 2005/04/13 02:33:09 deraadt Exp $ */
/*
* Top users/processes display for Unix
@@ -593,7 +593,7 @@ rundisplay(void)
* command strchr
*/
while (1) {
- len = read(0, &ch, 1);
+ len = read(STDIN_FILENO, &ch, 1);
if (len == -1 && errno == EINTR)
continue;
if (len == 0)
@@ -650,7 +650,7 @@ rundisplay(void)
standout("Hit any key to continue: ");
fflush(stdout);
while (1) {
- len = read(0, &ch, 1);
+ len = read(STDIN_FILENO, &ch, 1);
if (len == -1 && errno == EINTR)
continue;
if (len == 0)
@@ -673,7 +673,7 @@ rundisplay(void)
standout("Hit any key to continue: ");
fflush(stdout);
while (1) {
- len = read(0, &ch, 1);
+ len = read(STDIN_FILENO, &ch, 1);
if (len == -1 && errno == EINTR)
continue;
if (len == 0)
diff --git a/usr.bin/window/wwrint.c b/usr.bin/window/wwrint.c
index c5600347c2d..306d074b1ff 100644
--- a/usr.bin/window/wwrint.c
+++ b/usr.bin/window/wwrint.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wwrint.c,v 1.7 2003/08/01 22:01:38 david Exp $ */
+/* $OpenBSD: wwrint.c,v 1.8 2005/04/13 02:33:09 deraadt Exp $ */
/* $NetBSD: wwrint.c,v 1.4 1995/12/21 10:46:24 mycroft Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)wwrint.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: wwrint.c,v 1.7 2003/08/01 22:01:38 david Exp $";
+static char rcsid[] = "$OpenBSD: wwrint.c,v 1.8 2005/04/13 02:33:09 deraadt Exp $";
#endif
#endif /* not lint */
@@ -62,7 +62,7 @@ wwrint()
int n;
wwnread++;
- n = read(0, wwibq, wwibe - wwibq);
+ n = read(STDIN_FILENO, wwibq, wwibe - wwibq);
if (n > 0) {
if (tt.tt_rint)
n = (*tt.tt_rint)(wwibq, n);