lpq fix (displayq.c)
Kenneth J. Kutz
kutz at bgsuvax.UUCP
Fri Dec 9 08:09:26 AEST 1988
Description:
'lpq' displays conflicting messages if the print daemon is
down.
Repeat By:
1. /etc/lpc stop queue_name (stop a print queue)
2. lpq -Pqueue_name (display the newly stopped queue)
Systems:
4.3 BSD, Mt. Xinu BSD 4.3 + Sun NFS (edu)
Version:
/usr/src/usr.lib/lpr/displayq.c
displayq.c 5.1 (Berkeley) 6/6/85
or earlier.
Fix:
*** displayq.c.old Thu Dec 8 15:32:50 1988
--- displayq.c Thu Dec 8 16:59:59 1988
***************
*** 157,164 ****
if (fd >= 0) {
(void) flock(fd, LOCK_SH);
while ((i = read(fd, line, sizeof(line))) > 0)
(void) fwrite(line, 1, i, stdout);
! (void) close(fd); /* unlocks as well */
} else
putchar('\n');
}
--- 157,167 ----
if (fd >= 0) {
(void) flock(fd, LOCK_SH);
while ((i = read(fd, line, sizeof(line))) > 0)
+ if (strncmp(line, strcat(printer," is ready and printing"), 24) != 0)
(void) fwrite(line, 1, i, stdout);
! else
! putchar('\n');
! (void) close(fd); /* unlocks as well */
} else
putchar('\n');
}
--
--------------------------------------------------------------------
Kenneth J. Kutz kutz at andy.bgsu.edu <OR>
...!osu-cis!bgsuvax!kutz
--------------------------------------------------------------------
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list