diff options
author | Garance A Drosehn <gad@FreeBSD.org> | 2002-07-12 01:31:46 +0000 |
---|---|---|
committer | Garance A Drosehn <gad@FreeBSD.org> | 2002-07-12 01:31:46 +0000 |
commit | 4c2a3991673aeecf0285ed1b3cb0992aeb1cfd73 (patch) | |
tree | 6be998860c1973f2a10080d33a05f1bd0e85ecac /usr.sbin/lpr | |
parent | 079167d6d71a9f4ff3d706831fce69607a1e353a (diff) | |
download | src-4c2a3991673aeecf0285ed1b3cb0992aeb1cfd73.tar.gz src-4c2a3991673aeecf0285ed1b3cb0992aeb1cfd73.zip |
Add a SQS_QCHANGED option to set_qstate(). This will soon be used by 'lpc'.
Reviewed by: freebsd-print@bostonradio.org
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=99844
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r-- | usr.sbin/lpr/common_source/common.c | 11 | ||||
-rw-r--r-- | usr.sbin/lpr/common_source/lp.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index e382e69be9a3..c731f9bf3aea 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 e155b4d616d9..20438e38f712 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 */ |