diff options
author | sheldonh <sheldonh@FreeBSD.org> | 2001-07-26 11:02:39 +0000 |
---|---|---|
committer | sheldonh <sheldonh@FreeBSD.org> | 2001-07-26 11:02:39 +0000 |
commit | 9bfb9eedcddf3ab4e79532e863cf16c5ff381090 (patch) | |
tree | bd2ac2627dbeab7d3427432bb98d2c73085b61c1 /usr.bin/chat | |
parent | 505859f37d54f23b1ebc688851be182d4e1332c8 (diff) | |
download | FreeBSD-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 'usr.bin/chat')
-rw-r--r-- | usr.bin/chat/chat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/chat/chat.c b/usr.bin/chat/chat.c index fd71405..03133d8 100644 --- a/usr.bin/chat/chat.c +++ b/usr.bin/chat/chat.c @@ -969,7 +969,7 @@ register char *s; if (say_next) { say_next = 0; s = clean(s,0); - write(2, s, strlen(s)); + write(STDERR_FILENO, s, strlen(s)); free(s); return; } @@ -1118,7 +1118,7 @@ int get_char() int status; char c; - status = read(0, &c, 1); + status = read(STDIN_FILENO, &c, 1); switch (status) { case 1: @@ -1146,7 +1146,7 @@ int c; usleep(10000); /* inter-character typing delay (?) */ - status = write(1, &ch, 1); + status = write(STDOUT_FILENO, &ch, 1); switch (status) { case 1: @@ -1253,12 +1253,12 @@ int n; break; /* fall through */ case '\n': - write(2, "\n", 1); + write(STDERR_FILENO, "\n", 1); need_lf = 0; break; default: s = character(n); - write(2, s, strlen(s)); + write(STDERR_FILENO, s, strlen(s)); need_lf = 1; break; } |