summaryrefslogtreecommitdiffstats
path: root/usr.bin/vgrind
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 /usr.bin/vgrind
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 'usr.bin/vgrind')
-rw-r--r--usr.bin/vgrind/vgrindefs.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/vgrind/vgrindefs.c b/usr.bin/vgrind/vgrindefs.c
index 23f06bd..2839d1f 100644
--- a/usr.bin/vgrind/vgrindefs.c
+++ b/usr.bin/vgrind/vgrindefs.c
@@ -32,13 +32,16 @@
*/
#ifndef lint
-static char sccsid[] = "@(#)vgrindefs.c 8.1 (Berkeley) 6/6/93";
-#endif /* not lint */
+static const char rcsid[] =
+ "$FreeBSD$";
+#endif
#define BUFSIZ 1024
#define MAXHOP 32 /* max number of tc= indirections */
#include <ctype.h>
+#include <unistd.h>
+
/*
* grindcap - routines for dealing with the language definitions data base
* (code stolen almost totally from termcap)
@@ -103,7 +106,7 @@ tgetent(bp, name, file)
break;
}
if (cp >= bp+BUFSIZ) {
- write(2,"Vgrind entry too long\n", 23);
+ write(STDERR_FILENO, "Vgrind entry too long\n", 23);
break;
} else
*cp++ = c;
@@ -138,7 +141,7 @@ tnchktc()
p = tbuf + strlen(tbuf) - 2; /* before the last colon */
while (*--p != ':')
if (p<tbuf) {
- write(2, "Bad vgrind entry\n", 18);
+ write(STDERR_FILENO, "Bad vgrind entry\n", 18);
return (0);
}
p++;
@@ -151,7 +154,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 (tgetent(tcbuf, tcname, filename) != 1)
@@ -160,7 +163,7 @@ tnchktc()
;
l = p - holdtbuf + strlen(q);
if (l > BUFSIZ) {
- write(2, "Vgrind entry too long\n", 23);
+ write(STDERR_FILENO, "Vgrind entry too long\n", 23);
q[BUFSIZ - (p-tbuf)] = 0;
}
strcpy(p, q+1);
OpenPOWER on IntegriCloud