diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index e382e69be9a..c731f9bf3ae 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -275,6 +275,7 @@ set_qstate(int action, const char *lfname) struct stat stbuf; mode_t chgbits, newbits, oldmask; const char *failmsg, *okmsg; + static const char *nomsg = "no state msg"; int chres, errsav, fd, res, statres; /* @@ -298,6 +299,13 @@ set_qstate(int action, const char *lfname) newbits = LOCK_FILE_MODE; okmsg = NULL; failmsg = NULL; + if (action & SQS_QCHANGED) { + chgbits |= LFM_RESET_QUE; + newbits |= LFM_RESET_QUE; + /* The okmsg is not actually printed for this case. */ + okmsg = nomsg; + failmsg = "set queue-changed"; + } if (action & SQS_DISABLEQ) { chgbits |= LFM_QUEUE_DIS; newbits |= LFM_QUEUE_DIS; @@ -374,7 +382,8 @@ set_qstate(int action, const char *lfname) case SQS_CHGOK: case SQS_CREOK: case SQS_SKIPCREOK: - printf("\t%s\n", okmsg); + if (okmsg != nomsg) + printf("\t%s\n", okmsg); break; case SQS_CREFAIL: printf("\tcannot create lock file: %s\n", diff --git a/usr.sbin/lpr/common_source/lp.h b/usr.sbin/lpr/common_source/lp.h index e155b4d616d..20438e38f71 100644 --- a/usr.sbin/lpr/common_source/lp.h +++ b/usr.sbin/lpr/common_source/lp.h @@ -233,6 +233,7 @@ typedef enum { TR_SENDING, TR_RECVING, TR_PRINTING } tr_sendrecv; #define SQS_STOPP 0x02 /* Stop the printing of jobs */ #define SQS_ENABLEQ 0x10 /* Enable the queuing of new jobs */ #define SQS_STARTP 0x20 /* Start the printing of jobs */ +#define SQS_QCHANGED 0x80 /* The queue has changed (new jobs, etc) */ #define SQS_PARMERR -9 /* Invalid parameters from caller */ #define SQS_CREFAIL -3 /* File did not exist, and create failed */