diff options
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r-- | source3/printing/nt_printing.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 69e9233d27..bd968c66ab 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -50,6 +50,7 @@ open the NT printing tdb BOOL nt_printing_init(void) { static pid_t local_pid; + char *vstring = "INFO/version"; if (tdb && local_pid == sys_getpid()) return True; tdb = tdb_open(lock_path("ntdrivers.tdb"), 0, 0, O_RDWR|O_CREAT, 0600); @@ -61,12 +62,12 @@ BOOL nt_printing_init(void) local_pid = sys_getpid(); /* handle a Samba upgrade */ - tdb_writelock(tdb); - if (tdb_fetch_int(tdb, "INFO/version") != DATABASE_VERSION) { + tdb_lock_bystring(tdb, vstring); + if (tdb_fetch_int(tdb, vstring) != DATABASE_VERSION) { tdb_traverse(tdb, (tdb_traverse_func)tdb_delete, NULL); - tdb_store_int(tdb, "INFO/version", DATABASE_VERSION); + tdb_store_int(tdb, vstring, DATABASE_VERSION); } - tdb_writeunlock(tdb); + tdb_unlock_bystring(tdb, vstring); return True; } |