summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
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 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;