diff options
| author | Brian Somers <brian@FreeBSD.org> | 1997-05-13 20:52:31 +0000 |
|---|---|---|
| committer | Brian Somers <brian@FreeBSD.org> | 1997-05-13 20:52:31 +0000 |
| commit | 36abea5dc503e06bd6bab5cb3f3932ec695462be (patch) | |
| tree | 8c270b908d46b23417cf7385fd2d33fe429d83ac | |
| parent | 9f38c2e5915171b088ef6e3e01057e9100cbc724 (diff) | |
Notes
| -rw-r--r-- | usr.sbin/lpr/lpc/cmds.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c index 51e269e5b995..95e46ba67410 100644 --- a/usr.sbin/lpr/lpc/cmds.c +++ b/usr.sbin/lpr/lpc/cmds.c @@ -821,13 +821,17 @@ prstat() return; } (void) close(fd); - putchar('\t'); + /* print out the contents of the status file, if it exists */ (void) sprintf(line, "%s/%s", SD, ST); fd = open(line, O_RDONLY); if (fd >= 0) { (void) flock(fd, LOCK_SH); - while ((i = read(fd, line, sizeof(line))) > 0) - (void) fwrite(line, 1, i, stdout); + (void) fstat(fd, &stbuf); + if (stbuf.st_size > 0) { + putchar('\t'); + while ((i = read(fd, line, sizeof(line))) > 0) + (void) fwrite(line, 1, i, stdout); + } (void) close(fd); /* unlocks as well */ } } |
