summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorsheldonh <sheldonh@FreeBSD.org>2001-07-26 11:02:39 +0000
committersheldonh <sheldonh@FreeBSD.org>2001-07-26 11:02:39 +0000
commit9bfb9eedcddf3ab4e79532e863cf16c5ff381090 (patch)
treebd2ac2627dbeab7d3427432bb98d2c73085b61c1 /libexec
parent505859f37d54f23b1ebc688851be182d4e1332c8 (diff)
downloadFreeBSD-src-9bfb9eedcddf3ab4e79532e863cf16c5ff381090.zip
FreeBSD-src-9bfb9eedcddf3ab4e79532e863cf16c5ff381090.tar.gz
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 <david@phobia.ms>
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rexecd/rexecd.c6
-rw-r--r--libexec/rlogind/rlogind.c2
-rw-r--r--libexec/rtld-aout/rtld.c2
-rw-r--r--libexec/rtld-elf/debug.h2
-rw-r--r--libexec/rtld-elf/rtld.c2
-rw-r--r--libexec/uucpd/uucpd.c2
6 files changed, 8 insertions, 8 deletions
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) {
diff --git a/libexec/rlogind/rlogind.c b/libexec/rlogind/rlogind.c
index f1cea97..f0df9df 100644
--- a/libexec/rlogind/rlogind.c
+++ b/libexec/rlogind/rlogind.c
@@ -586,7 +586,7 @@ getstr(buf, cnt, errmsg)
char c;
do {
- if (read(0, &c, 1) != 1)
+ if (read(STDIN_FILENO, &c, 1) != 1)
exit(1);
if (--cnt < 0)
fatal(STDOUT_FILENO, errmsg, 0);
diff --git a/libexec/rtld-aout/rtld.c b/libexec/rtld-aout/rtld.c
index 3a66319..7f0908b 100644
--- a/libexec/rtld-aout/rtld.c
+++ b/libexec/rtld-aout/rtld.c
@@ -2329,7 +2329,7 @@ char *fmt;
#endif
vsnprintf(buf, sizeof(buf), fmt, ap);
- (void)write(1, buf, strlen(buf));
+ (void)write(STDOUT_FILENO, buf, strlen(buf));
va_end(ap);
}
diff --git a/libexec/rtld-elf/debug.h b/libexec/rtld-elf/debug.h
index 2600651..04314a9 100644
--- a/libexec/rtld-elf/debug.h
+++ b/libexec/rtld-elf/debug.h
@@ -53,7 +53,7 @@ extern int debug;
#define assert(cond) ((cond) ? (void) 0 : \
(msg("ld-elf.so.1: assert failed: " __FILE__ ":" \
__XSTRING(__LINE__) "\n"), abort()))
-#define msg(s) write(1, s, strlen(s))
+#define msg(s) write(STDOUT_FILENO, s, strlen(s))
#define trace() msg("ld-elf.so.1: " __XSTRING(__LINE__) "\n")
#endif /* DEBUG_H */
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 4e907f3..3b67cb5 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -2107,6 +2107,6 @@ xprintf(const char *fmt, ...)
va_start(ap, fmt);
vsprintf(buf, fmt, ap);
- (void)write(1, buf, strlen(buf));
+ (void)write(STDOUT_FILENO, buf, strlen(buf));
va_end(ap);
}
diff --git a/libexec/uucpd/uucpd.c b/libexec/uucpd/uucpd.c
index 7ca2b67..062c4ae 100644
--- a/libexec/uucpd/uucpd.c
+++ b/libexec/uucpd/uucpd.c
@@ -204,7 +204,7 @@ int readline(char start[], int num, int passw)
register int n = num;
while (n-- > 0) {
- if (read(0, &c, 1) <= 0)
+ if (read(STDIN_FILENO, &c, 1) <= 0)
return(-1);
c &= 0177;
if (c == '\n' || c == '\r' || c == '\0') {
OpenPOWER on IntegriCloud