diff options
author | Gerald Carter <jerry@samba.org> | 2005-01-05 16:20:35 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:53:46 -0500 |
commit | d097ea490525e7a35739dae6a295fd03ba52cfc0 (patch) | |
tree | 131dc7af2e2e944283c70d255d8ad5d6bbef0726 /source3/smbd/process.c | |
parent | 846b8d4cfdee815cd22d7e00b7f120668f9758a9 (diff) | |
download | samba-d097ea490525e7a35739dae6a295fd03ba52cfc0.tar.gz samba-d097ea490525e7a35739dae6a295fd03ba52cfc0.tar.xz samba-d097ea490525e7a35739dae6a295fd03ba52cfc0.zip |
r4539: patch from Rob -- adding real printcap name cache function to speed up printcap reloads
(This used to be commit 1cad5250932b963c2eb9b775221b13db386d601b)
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r-- | source3/smbd/process.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 1372ebbf458..54837c3b9ae 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1282,7 +1282,7 @@ static int setup_select_timeout(void) void check_reload(int t) { static time_t last_smb_conf_reload_time = 0; - static time_t last_load_printers_reload_time = 0; + static time_t last_printer_reload_time = 0; time_t printcap_cache_time = (time_t)lp_printcap_cache_time(); if(last_smb_conf_reload_time == 0) { @@ -1291,9 +1291,9 @@ void check_reload(int t) Then no printer is available till the first printers check is performed. A lower initial interval circumvents this. */ if ( printcap_cache_time > 60 ) - last_load_printers_reload_time = t - printcap_cache_time + 60; + last_printer_reload_time = t - printcap_cache_time + 60; else - last_load_printers_reload_time = t; + last_printer_reload_time = t; } if (reload_after_sighup || (t >= last_smb_conf_reload_time+SMBD_RELOAD_CHECK)) { @@ -1308,13 +1308,12 @@ void check_reload(int t) { /* see if it's time to reload or if the clock has been set back */ - if ( (t >= last_load_printers_reload_time+printcap_cache_time) - || (t-last_load_printers_reload_time < 0) ) + if ( (t >= last_printer_reload_time+printcap_cache_time) + || (t-last_printer_reload_time < 0) ) { DEBUG( 3,( "Printcap cache time expired.\n")); - remove_stale_printers(); - load_printers(); - last_load_printers_reload_time = t; + reload_printers(); + last_printer_reload_time = t; } } } |