summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-01-08 23:52:12 +0000
committerJeremy Allison <jra@samba.org>2002-01-08 23:52:12 +0000
commitea27606e5b1eed58826661fd4008ecafcc14bdf3 (patch)
tree05fc06a49659cf109ce1e8f0871970278b924830
parent31225b9377355a3836bb9236ccb8d16607d27b8f (diff)
downloadsamba-ea27606e5b1eed58826661fd4008ecafcc14bdf3.tar.gz
samba-ea27606e5b1eed58826661fd4008ecafcc14bdf3.tar.xz
samba-ea27606e5b1eed58826661fd4008ecafcc14bdf3.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.
-rw-r--r--source/printing/nt_printing.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index 685a13c6f61..9ed184c5548 100644
--- a/source/printing/nt_printing.c
+++ b/source/printing/nt_printing.c
@@ -2671,13 +2671,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);
}
/*
@@ -2710,7 +2715,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:
@@ -2762,7 +2767,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);