summaryrefslogtreecommitdiff
path: root/source3/printing/printer_list.c
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2010-09-16 00:57:39 +0200
committerBjörn Jacke <bj@sernet.de>2010-09-16 01:00:54 +0200
commitcd56e40117c542fd90362abe8130f7f8d8ee02e3 (patch)
tree525bd88ab134fc932b1585e0072759177352e548 /source3/printing/printer_list.c
parent447d96878a8b5a335447c37eca2a46b7133caa78 (diff)
downloadsamba-cd56e40117c542fd90362abe8130f7f8d8ee02e3.tar.gz
samba-cd56e40117c542fd90362abe8130f7f8d8ee02e3.tar.bz2
samba-cd56e40117c542fd90362abe8130f7f8d8ee02e3.zip
s3/printing: avoid a possible race condition in the cache timeout
Diffstat (limited to 'source3/printing/printer_list.c')
-rw-r--r--source3/printing/printer_list.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source3/printing/printer_list.c b/source3/printing/printer_list.c
index d02ab88663..f52dfcffa5 100644
--- a/source3/printing/printer_list.c
+++ b/source3/printing/printer_list.c
@@ -218,7 +218,6 @@ done:
bool printer_list_need_refresh(void)
{
NTSTATUS status;
- time_t now = time_mono(NULL);
time_t last_refresh;
int timediff;
@@ -226,7 +225,7 @@ bool printer_list_need_refresh(void)
if (!NT_STATUS_IS_OK(status)) {
return true;
}
- timediff = now - last_refresh;
+ timediff = time_mono(NULL) - last_refresh;
if (timediff > 1 ) {
/* if refresh occurred more than 1s (TODO:use lp_printcap_cache_time) ago,