diff options
author | Günther Deschner <gd@samba.org> | 2009-05-06 01:10:33 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-05-06 10:19:04 +0200 |
commit | 9966541f89b45834cdf63060202621f885bf9f5c (patch) | |
tree | 0f689b5ae92a753a6b18aba932a8fea2dfd164bf /source3/printing | |
parent | 4cbd0c77e42627c76dda88af5326ef91415a652d (diff) | |
download | samba-9966541f89b45834cdf63060202621f885bf9f5c.tar.gz samba-9966541f89b45834cdf63060202621f885bf9f5c.tar.bz2 samba-9966541f89b45834cdf63060202621f885bf9f5c.zip |
s3-printing: simplify print_queue helper functions and return WERROR.
Guenther
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/printing.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c index a661d3dbdc..83b5ac8b43 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -2797,16 +2797,14 @@ int print_queue_status(int snum, Pause a queue. ****************************************************************************/ -bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum, - WERROR *errcode) +WERROR print_queue_pause(struct auth_serversupplied_info *server_info, int snum) { int ret; struct printif *current_printif = get_printer_fns( snum ); if (!print_access_check(server_info, snum, PRINTER_ACCESS_ADMINISTER)) { - *errcode = WERR_ACCESS_DENIED; - return False; + return WERR_ACCESS_DENIED; } @@ -2817,8 +2815,7 @@ bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum, unbecome_root(); if (ret != 0) { - *errcode = WERR_INVALID_PARAM; - return False; + return WERR_INVALID_PARAM; } /* force update the database */ @@ -2828,23 +2825,21 @@ bool print_queue_pause(struct auth_serversupplied_info *server_info, int snum, notify_printer_status(snum, PRINTER_STATUS_PAUSED); - return True; + return WERR_OK; } /**************************************************************************** Resume a queue. ****************************************************************************/ -bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum, - WERROR *errcode) +WERROR print_queue_resume(struct auth_serversupplied_info *server_info, int snum) { int ret; struct printif *current_printif = get_printer_fns( snum ); if (!print_access_check(server_info, snum, PRINTER_ACCESS_ADMINISTER)) { - *errcode = WERR_ACCESS_DENIED; - return False; + return WERR_ACCESS_DENIED; } become_root(); @@ -2854,8 +2849,7 @@ bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum, unbecome_root(); if (ret != 0) { - *errcode = WERR_INVALID_PARAM; - return False; + return WERR_INVALID_PARAM; } /* make sure the database is up to date */ @@ -2866,15 +2860,14 @@ bool print_queue_resume(struct auth_serversupplied_info *server_info, int snum, notify_printer_status(snum, PRINTER_STATUS_OK); - return True; + return WERR_OK; } /**************************************************************************** Purge a queue - implemented by deleting all jobs that we can delete. ****************************************************************************/ -bool print_queue_purge(struct auth_serversupplied_info *server_info, int snum, - WERROR *errcode) +WERROR print_queue_purge(struct auth_serversupplied_info *server_info, int snum) { print_queue_struct *queue; print_status_struct status; @@ -2908,5 +2901,5 @@ bool print_queue_purge(struct auth_serversupplied_info *server_info, int snum, SAFE_FREE(queue); - return True; + return WERR_OK; } |