diff options
author | Jeremy Allison <jra@samba.org> | 2002-01-08 23:50:14 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-01-08 23:50:14 +0000 |
commit | eca00cab66fd5971f9b89796272cd5d4527ec34b (patch) | |
tree | 09161733f5638cb45bda0113f60b2eb3764346e6 /source3/printing | |
parent | e54261b82cde4188a8a489d8b7229c7aee8a4f01 (diff) | |
download | samba-eca00cab66fd5971f9b89796272cd5d4527ec34b.tar.gz samba-eca00cab66fd5971f9b89796272cd5d4527ec34b.tar.bz2 samba-eca00cab66fd5971f9b89796272cd5d4527ec34b.zip |
My previous fix had a bug....
This is SO NASTY as some drivers need this to change, others need it
static. This value will change every second, and I must hope that this
is enough..... DON'T CHANGE THIS CODE WITHOUT A TEST MATRIX THE SIZE OF
UTAH !
Jeremy.
(This used to be commit 9fb780d951babeaf5f5b82903c717ff5ccf831cd)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/nt_printing.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 81866ca9e1..b49767eac7 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -2628,13 +2628,18 @@ void get_printer_subst_params(int snum, fstring *printername, fstring *sharename /**************************************************************************** Update the changeid time. + This is SO NASTY as some drivers need this to change, others need it + static. This value will change every second, and I must hope that this + is enough..... DON'T CHANGE THIS CODE WITHOUT A TEST MATRIX THE SIZE OF + UTAH ! JRA. ****************************************************************************/ -static uint32 rev_changeid(uint32 changeid) +static uint32 rev_changeid(void) { - if (changeid == 0) - changeid = time(NULL); - return changeid++; + static time_t start_time; + if (start_time == 0) + start_time = time(NULL); + return (((time(NULL) - start_time)+1)*1000); } /* @@ -2667,7 +2672,7 @@ WERROR mod_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level) of client's spoolss service in order for the client's cache to show updates */ - printer.info_2->changeid = rev_changeid(printer.info_2->changeid); + printer.info_2->changeid = rev_changeid(); /* * Because one day someone will ask: @@ -2719,7 +2724,7 @@ WERROR add_a_printer(NT_PRINTER_INFO_LEVEL printer, uint32 level) * --jerry */ - printer.info_2->changeid = rev_changeid(printer.info_2->changeid); + printer.info_2->changeid = rev_changeid(); printer.info_2->c_setprinter++; result=update_a_printer_2(printer.info_2); |