summaryrefslogtreecommitdiffstats
path: root/source/printing
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-04-17 11:49:06 +0000
committerVolker Lendecke <vlendec@samba.org>2006-04-17 11:49:06 +0000
commitabf6563746cc9e21071df0a92d070847e807506d (patch)
tree3a25ebba6391f75a155a703a11929cb36012c916 /source/printing
parentffec63f12a6338dd36ff7063dd120bd96921b909 (diff)
downloadsamba-abf6563746cc9e21071df0a92d070847e807506d.tar.gz
samba-abf6563746cc9e21071df0a92d070847e807506d.tar.xz
samba-abf6563746cc9e21071df0a92d070847e807506d.zip
r15101: Little step towards getting Samba4 tdb into 3: tdb_lock_bystring does not
have the timeout argument in Samba4. Add a new routine tdb_lock_bystring_with_timeout. Volker
Diffstat (limited to 'source/printing')
-rw-r--r--source/printing/notify.c2
-rw-r--r--source/printing/nt_printing.c2
-rw-r--r--source/printing/printing.c10
3 files changed, 7 insertions, 7 deletions
diff --git a/source/printing/notify.c b/source/printing/notify.c
index e71d9e6f259..f27eb2011ff 100644
--- a/source/printing/notify.c
+++ b/source/printing/notify.c
@@ -520,7 +520,7 @@ BOOL print_notify_pid_list(const char *printername, TALLOC_CTX *mem_ctx, size_t
return False;
tdb = pdb->tdb;
- if (tdb_read_lock_bystring(tdb, NOTIFY_PID_LIST_KEY, 10) == -1) {
+ if (tdb_read_lock_bystring_with_timeout(tdb, NOTIFY_PID_LIST_KEY, 10) == -1) {
DEBUG(0,("print_notify_pid_list: Failed to lock printer %s database\n",
printername));
if (pdb)
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index 727d226e2a5..1a664fbb34e 100644
--- a/source/printing/nt_printing.c
+++ b/source/printing/nt_printing.c
@@ -673,7 +673,7 @@ uint32 update_c_setprinter(BOOL initialize)
int32 c_setprinter;
int32 printer_count = 0;
- tdb_lock_bystring(tdb_printers, GLOBAL_C_SETPRINTER, 0);
+ tdb_lock_bystring(tdb_printers, GLOBAL_C_SETPRINTER);
/* Traverse the tdb, counting the printers */
tdb_traverse(tdb_printers, traverse_counting_printers, (void *)&printer_count);
diff --git a/source/printing/printing.c b/source/printing/printing.c
index d9acd2de725..b131727f8a4 100644
--- a/source/printing/printing.c
+++ b/source/printing/printing.c
@@ -197,7 +197,7 @@ BOOL print_backend_init(void)
pdb = get_print_db_byname(lp_const_servicename(snum));
if (!pdb)
continue;
- if (tdb_lock_bystring(pdb->tdb, sversion, 0) == -1) {
+ if (tdb_lock_bystring(pdb->tdb, sversion) == -1) {
DEBUG(0,("print_backend_init: Failed to open printer %s database\n", lp_const_servicename(snum) ));
release_print_db(pdb);
return False;
@@ -1291,7 +1291,7 @@ static void print_queue_update_with_lock( const char *sharename,
slprintf(keystr, sizeof(keystr) - 1, "LOCK/%s", sharename);
/* Only wait 10 seconds for this. */
- if (tdb_lock_bystring(pdb->tdb, keystr, 10) == -1) {
+ if (tdb_lock_bystring_with_timeout(pdb->tdb, keystr, 10) == -1) {
DEBUG(0,("print_queue_update_with_lock: Failed to lock printer %s database\n", sharename));
release_print_db(pdb);
return;
@@ -1563,7 +1563,7 @@ BOOL print_notify_register_pid(int snum)
tdb = pdb->tdb;
}
- if (tdb_lock_bystring(tdb, NOTIFY_PID_LIST_KEY, 10) == -1) {
+ if (tdb_lock_bystring_with_timeout(tdb, NOTIFY_PID_LIST_KEY, 10) == -1) {
DEBUG(0,("print_notify_register_pid: Failed to lock printer %s\n",
printername));
if (pdb)
@@ -1653,7 +1653,7 @@ BOOL print_notify_deregister_pid(int snum)
tdb = pdb->tdb;
}
- if (tdb_lock_bystring(tdb, NOTIFY_PID_LIST_KEY, 10) == -1) {
+ if (tdb_lock_bystring_with_timeout(tdb, NOTIFY_PID_LIST_KEY, 10) == -1) {
DEBUG(0,("print_notify_register_pid: Failed to lock \
printer %s database\n", printername));
if (pdb)
@@ -2205,7 +2205,7 @@ static BOOL allocate_print_jobid(struct tdb_print_db *pdb, int snum, const char
for (i = 0; i < 3; i++) {
/* Lock the database - only wait 20 seconds. */
- if (tdb_lock_bystring(pdb->tdb, "INFO/nextjob", 20) == -1) {
+ if (tdb_lock_bystring_with_timeout(pdb->tdb, "INFO/nextjob", 20) == -1) {
DEBUG(0,("allocate_print_jobid: failed to lock printing database %s\n", sharename));
return False;
}