diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/lpr/common_source/displayq.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c index a974d6f..a5b8b26 100644 --- a/usr.sbin/lpr/common_source/displayq.c +++ b/usr.sbin/lpr/common_source/displayq.c @@ -73,6 +73,8 @@ static long totsize; /* total print job size in bytes */ static char *head0 = "Rank Owner Job Files"; static char *head1 = "Total Size\n"; +static void alarmhandler __P((int)); + /* * Display the current state of the queue. Format = 1 if long format. */ @@ -86,6 +88,7 @@ displayq(format) struct queue **queue; struct stat statb; FILE *fp; + void (*savealrm)(int); lflag = format; totsize = 0; @@ -212,7 +215,10 @@ displayq(format) (void) strcpy(cp, user[i]); } strcat(line, "\n"); + savealrm = signal(SIGALRM, alarmhandler); + alarm(10); fd = getport(RM, 0); + (void)signal(SIGALRM, savealrm); if (fd < 0) { if (from != host) printf("%s: ", host); @@ -446,3 +452,10 @@ prank(n) col += strlen(rline); printf("%s", rline); } + +void +alarmhandler(signo) + int signo; +{ + /* ignored */ +} |