summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2001-07-22 00:03:21 +0000
committergad <gad@FreeBSD.org>2001-07-22 00:03:21 +0000
commit352a508a9620f9dc3ff9678d9ec38872980977c6 (patch)
tree8e0cdbe1e8db8b5255d1519e39572c297477f897
parenta61f9aad89ebdaf2342707127d20abd90a16f48d (diff)
downloadFreeBSD-src-352a508a9620f9dc3ff9678d9ec38872980977c6.zip
FreeBSD-src-352a508a9620f9dc3ff9678d9ec38872980977c6.tar.gz
Change a few read & write calls to use 'STDOUT_FILENO' instead of '1'.
Submitted by: David Hill <david@phobia.ms> Reviewed by: freebsd-audit (a little) MFC after: 1 week
-rw-r--r--usr.sbin/lpr/lpd/lpd.c2
-rw-r--r--usr.sbin/lpr/lpd/recvjob.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c
index b48cf25..542ef3c 100644
--- a/usr.sbin/lpr/lpd/lpd.c
+++ b/usr.sbin/lpr/lpd/lpd.c
@@ -459,7 +459,7 @@ doit(void)
do {
if (cp >= &cbuf[sizeof(cbuf) - 1])
fatal(0, "Command line too long");
- if ((n = read(1, cp, 1)) != 1) {
+ if ((n = read(STDOUT_FILENO, cp, 1)) != 1) {
if (n < 0)
fatal(0, "Lost connection");
return;
diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c
index 4d291c2..d473680 100644
--- a/usr.sbin/lpr/lpd/recvjob.c
+++ b/usr.sbin/lpr/lpd/recvjob.c
@@ -69,7 +69,7 @@ static const char rcsid[] =
#include "extern.h"
#include "pathnames.h"
-#define ack() (void) write(1, sp, 1);
+#define ack() (void) write(STDOUT_FILENO, sp, 1);
static char dfname[NAME_MAX]; /* data files */
static int minfree; /* keep at least minfree blocks available */
@@ -158,7 +158,7 @@ readjob(struct printer *pp)
*/
cp = line;
do {
- if ((size = read(1, cp, 1)) != 1) {
+ if ((size = read(STDOUT_FILENO, cp, 1)) != 1) {
if (size < 0) {
frecverr("%s: lost connection",
pp->printer);
@@ -201,7 +201,7 @@ readjob(struct printer *pp)
frecverr("readjob: %s: illegal path name",
tfname);
if (!chksize(size)) {
- (void) write(1, "\2", 1);
+ (void) write(STDOUT_FILENO, "\2", 1);
continue;
}
if (!readfile(pp, tfname, size)) {
@@ -226,7 +226,7 @@ readjob(struct printer *pp)
if (*cp++ != ' ')
break;
if (!chksize(size)) {
- (void) write(1, "\2", 1);
+ (void) write(STDOUT_FILENO, "\2", 1);
continue;
}
(void) strncpy(dfname, cp, sizeof(dfname) - 1);
@@ -273,7 +273,7 @@ readfile(struct printer *pp, char *file, int size)
if (i + amt > size)
amt = size - i;
do {
- j = read(1, cp, amt);
+ j = read(STDOUT_FILENO, cp, amt);
if (j <= 0) {
frecverr("%s: lost connection", pp->printer);
/*NOTREACHED*/
@@ -308,7 +308,7 @@ noresponse(void)
{
char resp;
- if (read(1, &resp, 1) != 1) {
+ if (read(STDOUT_FILENO, &resp, 1) != 1) {
frecverr("lost connection in noresponse()");
/*NOTREACHED*/
}
OpenPOWER on IntegriCloud