mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
Tuyrn debug timestamps on by default.
Add Tim's lpq race fix. Jeremy. (This used to be commit d43405bc47c95bf8c906035cba23bf95d252d13b)
This commit is contained in:
parent
4bce271e4f
commit
e8d43bbfe4
@ -1213,7 +1213,7 @@ static void init_globals(void)
|
||||
Globals.bStripDot = False;
|
||||
Globals.syslog = 1;
|
||||
Globals.bSyslogOnly = False;
|
||||
Globals.bTimestampLogs = False;
|
||||
Globals.bTimestampLogs = True;
|
||||
Globals.bDebugHiresTimestamp = False;
|
||||
Globals.bDebugPid = False;
|
||||
Globals.bDebugUid = False;
|
||||
|
@ -271,11 +271,23 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
|
||||
if (jobid == qid) break;
|
||||
}
|
||||
|
||||
/* The job isn't in the system queue - we have to assume it has
|
||||
completed, so delete the database entry. */
|
||||
|
||||
if (i == ts->qcount) {
|
||||
/* the job isn't in the system queue - we have to
|
||||
assume it has completed, so delete the database
|
||||
entry */
|
||||
tdb_delete(t, key);
|
||||
time_t cur_t = time(NULL);
|
||||
|
||||
/* A race can occur between the time a job is spooled and
|
||||
when it appears in the lpq output. This happens when
|
||||
the job is added to printing.tdb when another smbd
|
||||
running print_queue_update() has completed a lpq and
|
||||
is currently traversing the printing tdb and deleting jobs.
|
||||
A workaround is to not delete the job if it has been
|
||||
submitted less than lp_lpqcachetime() seconds ago. */
|
||||
|
||||
if ((cur_t - pjob.starttime) > lp_lpqcachetime()) {
|
||||
tdb_delete(t, key);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user