summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lpr/common_source/displayq.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-05-05 19:28:34 +0000
committerjoerg <joerg@FreeBSD.org>1996-05-05 19:28:34 +0000
commitf53c8a2ec7b10da3bb55681c44d9e187774e535a (patch)
tree8d050a8da34a5a2d0109e50430becc9882d346f5 /usr.sbin/lpr/common_source/displayq.c
parent289d83e1bca7867454702376e7598825b3bf49a2 (diff)
downloadFreeBSD-src-f53c8a2ec7b10da3bb55681c44d9e187774e535a.zip
FreeBSD-src-f53c8a2ec7b10da3bb55681c44d9e187774e535a.tar.gz
Fix my botched 4.4Lite2 import, and revert these files to their HEAD
versions.
Diffstat (limited to 'usr.sbin/lpr/common_source/displayq.c')
-rw-r--r--usr.sbin/lpr/common_source/displayq.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c
index 34ca840..59d3cc9 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 <sys/param.h>
#include <sys/stat.h>
-#include <sys/file.h>
#include <signal.h>
#include <fcntl.h>
@@ -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');
OpenPOWER on IntegriCloud