diff options
author | Jeremy Allison <jra@samba.org> | 2000-11-04 19:48:53 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-11-04 19:48:53 +0000 |
commit | a6ff0d29d6dc60942463adebd819b87da4775da5 (patch) | |
tree | cbee62dd52da17562fd6e48205c2d7aec2265492 /source3/printing | |
parent | 61b659faafdb33097e664d034f10b930bf9f6a0b (diff) | |
download | samba-a6ff0d29d6dc60942463adebd819b87da4775da5.tar.gz samba-a6ff0d29d6dc60942463adebd819b87da4775da5.tar.bz2 samba-a6ff0d29d6dc60942463adebd819b87da4775da5.zip |
Merge from Tim - don't reinsert UNIX job if already exists.
Jeremy.
(This used to be commit a33c395c98d80f620257fed480d5824fc609d9c9)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/printing.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c index e1f58ba6a5..14f39b858c 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -126,6 +126,7 @@ static BOOL print_job_store(int jobid, struct printjob *pjob) TDB_DATA d; d.dptr = (void *)pjob; d.dsize = sizeof(*pjob); + return (0 == tdb_store(tdb, print_key(jobid), d, TDB_REPLACE)); } @@ -197,6 +198,13 @@ static void print_unix_job(int snum, print_queue_struct *q) int jobid = q->job + UNIX_JOB_START; struct printjob pj; + /* Don't re-insert a unix job if it already exists as it mucks + up the timestamp. */ + + if (tdb_exists(tdb, print_key(jobid))) { + return; + } + ZERO_STRUCT(pj); pj.pid = (pid_t)-1; |