From 9bfb9eedcddf3ab4e79532e863cf16c5ff381090 Mon Sep 17 00:00:00 2001 From: sheldonh Date: Thu, 26 Jul 2001 11:02:39 +0000 Subject: Use STD{ERR,IN,OUT}_FILENO instead of their numeric values. The definitions are more readable, and it's possible that they're more portable to pathalogical platforms. Submitted by: David Hill --- libexec/rexecd/rexecd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libexec/rexecd') diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index f820b90..57bb14c 100644 --- a/libexec/rexecd/rexecd.c +++ b/libexec/rexecd/rexecd.c @@ -237,7 +237,7 @@ doit(f, fromp) syslog(LOG_INFO, "login from %s as %s", remote, user); - (void) write(2, "\0", 1); + (void) write(STDERR_FILENO, "\0", 1); if (port) { (void) pipe(pv); pid = fork(); @@ -314,7 +314,7 @@ error(fmt, a1, a2, a3) buf[0] = 1; (void) snprintf(buf+1, sizeof(buf) - 1, fmt, a1, a2, a3); - (void) write(2, buf, strlen(buf)); + (void) write(STDERR_FILENO, buf, strlen(buf)); } void @@ -326,7 +326,7 @@ getstr(buf, cnt, err) char c; do { - if (read(0, &c, 1) != 1) + if (read(STDIN_FILENO, &c, 1) != 1) exit(1); *buf++ = c; if (--cnt == 0) { -- cgit v1.1