summaryrefslogtreecommitdiffstats
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-11-04 19:48:53 +0000
committerJeremy Allison <jra@samba.org>2000-11-04 19:48:53 +0000
commita6ff0d29d6dc60942463adebd819b87da4775da5 (patch)
treecbee62dd52da17562fd6e48205c2d7aec2265492 /source3/printing
parent61b659faafdb33097e664d034f10b930bf9f6a0b (diff)
downloadsamba-a6ff0d29d6dc60942463adebd819b87da4775da5.tar.gz
samba-a6ff0d29d6dc60942463adebd819b87da4775da5.tar.xz
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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index e1f58ba6a5b..14f39b858cb 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;