diff options
author | Jeremy Allison <jra@samba.org> | 2002-06-28 23:11:31 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-06-28 23:11:31 +0000 |
commit | e808eb2758ff4ad1eed7b50a02865b87ba0c068e (patch) | |
tree | 8351b223fca933d90cec174ce99b45129959b3ac /source/printing/printing.c | |
parent | b35fc30c37fa894acea3fcb7b48ee9841d1bd5e8 (diff) | |
download | samba-e808eb2758ff4ad1eed7b50a02865b87ba0c068e.tar.gz samba-e808eb2758ff4ad1eed7b50a02865b87ba0c068e.tar.xz samba-e808eb2758ff4ad1eed7b50a02865b87ba0c068e.zip |
Shut down printing tdb correctly - this will be more important when I go
to a tdb per-queue for scalability.
Jeremy.
Diffstat (limited to 'source/printing/printing.c')
-rw-r--r-- | source/printing/printing.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source/printing/printing.c b/source/printing/printing.c index 6ecaf3c9bfa..f8b3c9cef09 100644 --- a/source/printing/printing.c +++ b/source/printing/printing.c @@ -82,6 +82,18 @@ BOOL print_backend_init(void) } /**************************************************************************** + Shut down printing backend. Called once at shutdown to close the tdb. +****************************************************************************/ + +void printing_end(void) +{ + if (tdb) { + tdb_close(tdb); + tdb = NULL; + } +} + +/**************************************************************************** Useful function to generate a tdb key. ****************************************************************************/ @@ -253,8 +265,9 @@ static BOOL pjob_store(int jobid, struct printjob *pjob) } /**************************************************************************** -remove a job structure from the database + Remove a job structure from the database. ****************************************************************************/ + static void pjob_delete(int jobid) { int snum; @@ -486,7 +499,7 @@ static void set_updating_pid(fstring printer_name, BOOL delete) } /**************************************************************************** -update the internal database from the system print queue for a queue + Update the internal database from the system print queue for a queue. ****************************************************************************/ static void print_queue_update(int snum) @@ -1494,7 +1507,8 @@ BOOL print_queue_resume(struct current_user *user, int snum, WERROR *errcode) } /* make sure the database is up to date */ - if (print_cache_expired(snum)) print_queue_update(snum); + if (print_cache_expired(snum)) + print_queue_update(snum); /* Send a printer notify message */ |