summaryrefslogtreecommitdiff
path: root/source3/printing/printing.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-06-20 18:40:33 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-06-20 11:18:35 +0200
commitd925b327f4703cc141c0a7f3eec912dba8440880 (patch)
treea9d190b375dcae03863591d8f31688dc949fa3eb /source3/printing/printing.c
parentca1936fbb26af0ee8d0421ae6a4e07a0f62311d9 (diff)
downloadsamba-d925b327f4703cc141c0a7f3eec912dba8440880.tar.gz
samba-d925b327f4703cc141c0a7f3eec912dba8440880.tar.bz2
samba-d925b327f4703cc141c0a7f3eec912dba8440880.zip
tdb_compat: Higher level API fixes.
My previous patches fixed up all direct TDB callers, but there are a few utility functions and the db_context functions which are still using the old -1 / 0 return codes. It's clearer to fix up all the callers of these too, so everywhere is consistent: non-zero means an error. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'source3/printing/printing.c')
-rw-r--r--source3/printing/printing.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 6503407f82..0c070c7668 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -208,7 +208,7 @@ bool print_backend_init(struct messaging_context *msg_ctx)
pdb = get_print_db_byname(lp_const_servicename(snum));
if (!pdb)
continue;
- if (tdb_lock_bystring(pdb->tdb, sversion) == -1) {
+ if (tdb_lock_bystring(pdb->tdb, sversion) != 0) {
DEBUG(0,("print_backend_init: Failed to open printer %s database\n", lp_const_servicename(snum) ));
release_print_db(pdb);
return False;
@@ -1516,7 +1516,7 @@ static void print_queue_update_with_lock( struct tevent_context *ev,
slprintf(keystr, sizeof(keystr) - 1, "LOCK/%s", sharename);
/* Only wait 10 seconds for this. */
- if (tdb_lock_bystring_with_timeout(pdb->tdb, keystr, 10) == -1) {
+ if (tdb_lock_bystring_with_timeout(pdb->tdb, keystr, 10) != 0) {
DEBUG(0,("print_queue_update_with_lock: Failed to lock printer %s database\n", sharename));
release_print_db(pdb);
return;
@@ -1885,7 +1885,7 @@ bool print_notify_register_pid(int snum)
tdb = pdb->tdb;
}
- if (tdb_lock_bystring_with_timeout(tdb, NOTIFY_PID_LIST_KEY, 10) == -1) {
+ if (tdb_lock_bystring_with_timeout(tdb, NOTIFY_PID_LIST_KEY, 10) != 0) {
DEBUG(0,("print_notify_register_pid: Failed to lock printer %s\n",
printername));
if (pdb)
@@ -1975,7 +1975,7 @@ bool print_notify_deregister_pid(int snum)
tdb = pdb->tdb;
}
- if (tdb_lock_bystring_with_timeout(tdb, NOTIFY_PID_LIST_KEY, 10) == -1) {
+ if (tdb_lock_bystring_with_timeout(tdb, NOTIFY_PID_LIST_KEY, 10) != 0) {
DEBUG(0,("print_notify_register_pid: Failed to lock \
printer %s database\n", printername));
if (pdb)
@@ -2134,7 +2134,7 @@ static bool remove_from_jobs_added(const char* sharename, uint32 jobid)
key = string_tdb_data("INFO/jobs_added");
- if (tdb_chainlock_with_timeout(pdb->tdb, key, 5) == -1)
+ if (tdb_chainlock_with_timeout(pdb->tdb, key, 5) != 0)
goto out;
gotlock = True;
@@ -2561,7 +2561,7 @@ static WERROR allocate_print_jobid(struct tdb_print_db *pdb, int snum,
/* Lock the database - only wait 20 seconds. */
ret = tdb_lock_bystring_with_timeout(pdb->tdb,
"INFO/nextjob", 20);
- if (ret == -1) {
+ if (ret != 0) {
DEBUG(0, ("allocate_print_jobid: "
"Failed to lock printing database %s\n",
sharename));
@@ -2589,7 +2589,7 @@ static WERROR allocate_print_jobid(struct tdb_print_db *pdb, int snum,
jobid = NEXT_JOBID(jobid);
ret = tdb_store_int32(pdb->tdb, "INFO/nextjob", jobid);
- if (ret == -1) {
+ if (ret != 0) {
terr = tdb_error(pdb->tdb);
DEBUG(3, ("allocate_print_jobid: "
"Failed to store INFO/nextjob.\n"));