From 4ebd2ee4919ec502011af6dcf62c2e898679ba7c Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sun, 5 May 1996 19:28:34 +0000 Subject: [PATCH] Fix my botched 4.4Lite2 import, and revert these files to their HEAD versions. --- usr.sbin/lpr/common_source/displayq.c | 27 +++++++++++++-------------- usr.sbin/lpr/common_source/rmjob.c | 6 +++--- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c index 34ca840156b6..59d3cc9c2ad6 100644 --- a/usr.sbin/lpr/common_source/displayq.c +++ b/usr.sbin/lpr/common_source/displayq.c @@ -32,12 +32,11 @@ */ #ifndef lint -static char sccsid[] = "@(#)displayq.c 8.4 (Berkeley) 4/28/95"; +static char sccsid[] = "@(#)displayq.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #include #include -#include #include #include @@ -125,7 +124,7 @@ displayq(format) fatal("cannot examine spooling area\n"); if (stat(LO, &statb) >= 0) { if (statb.st_mode & 0100) { - if (remote) + if (sendtorem) printf("%s: ", host); printf("Warning: %s is down: ", printer); fd = open(ST, O_RDONLY); @@ -138,7 +137,7 @@ displayq(format) putchar('\n'); } if (statb.st_mode & 010) { - if (remote) + if (sendtorem) printf("%s: ", host); printf("Warning: %s queue is turned off\n", printer); } @@ -151,8 +150,8 @@ displayq(format) else { /* get daemon pid */ cp = current; - while ((i = getc(fp)) != EOF && i != '\n') - *cp++ = i; + while ((*cp = getc(fp)) != EOF && *cp != '\n') + cp++; *cp = '\0'; i = atoi(current); if (i <= 0 || kill(i, 0) < 0) @@ -160,13 +159,13 @@ displayq(format) else { /* read current file name */ cp = current; - while ((i = getc(fp)) != EOF && i != '\n') - *cp++ = i; + while ((*cp = getc(fp)) != EOF && *cp != '\n') + cp++; *cp = '\0'; /* * Print the status file. */ - if (remote) + if (sendtorem) printf("%s: ", host); fd = open(ST, O_RDONLY); if (fd >= 0) { @@ -192,7 +191,7 @@ displayq(format) } free(queue); } - if (!remote) { + if (!sendtorem) { if (nitems == 0) puts("no entries"); return; @@ -216,7 +215,7 @@ displayq(format) (void) strcpy(cp, user[i]); } strcat(line, "\n"); - fd = getport(RM, 0); + fd = getport(RM); if (fd < 0) { if (from != host) printf("%s: ", host); @@ -238,7 +237,7 @@ displayq(format) void warn() { - if (remote) + if (sendtorem) printf("\n%s: ", host); puts("Warning: no daemon present"); current[0] = '\0'; @@ -272,7 +271,7 @@ inform(cf) if (rank < 0) rank = 0; - if (remote || garbage || strcmp(cf, current)) + if (sendtorem || garbage || strcmp(cf, current)) rank++; j = 0; while (getline(cfp)) { @@ -417,7 +416,7 @@ ldump(nfile, file, copies) else printf("%-32s", nfile); if (*file && !stat(file, &lbuf)) - printf(" %ld bytes", (long)lbuf.st_size); + printf(" %qd bytes", lbuf.st_size); else printf(" ??? bytes"); putchar('\n'); diff --git a/usr.sbin/lpr/common_source/rmjob.c b/usr.sbin/lpr/common_source/rmjob.c index bdfe853fcd23..74a94d8a4c97 100644 --- a/usr.sbin/lpr/common_source/rmjob.c +++ b/usr.sbin/lpr/common_source/rmjob.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)rmjob.c 8.2 (Berkeley) 4/28/95"; +static char sccsid[] = "@(#)rmjob.c 8.1 (Berkeley) 6/6/93"; #endif /* not lint */ #include @@ -292,7 +292,7 @@ rmremote() register int i, rem; char buf[BUFSIZ]; - if (!remote) + if (!sendtorem) return; /* not sending to a remote machine */ /* @@ -313,7 +313,7 @@ rmremote() (void) sprintf(cp, " %d", requ[i]); } strcat(cp, "\n"); - rem = getport(RM, 0); + rem = getport(RM); if (rem < 0) { if (from != host) printf("%s: ", host);