summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2000-05-12 06:27:35 +0000
committerTim Potter <tpot@samba.org>2000-05-12 06:27:35 +0000
commit4cdc54ba244f72a4a143e7a0e0c0b4fcfaa13d3c (patch)
treeca65489e43e909ee8e5dbda7a50c415c40fc8d45 /source3/printing
parent7738941ccf4ebcaccea872619c465a45fb7bf0ae (diff)
downloadsamba-4cdc54ba244f72a4a143e7a0e0c0b4fcfaa13d3c.tar.gz
samba-4cdc54ba244f72a4a143e7a0e0c0b4fcfaa13d3c.tar.bz2
samba-4cdc54ba244f72a4a143e7a0e0c0b4fcfaa13d3c.zip
While we're all making incompatible tdb changes, I changed the implementation
of tdb_{store,get}_int() to store the length of the string key + 1 so the stored key contains the trailing NULL character. This allows normal string library routines to manipulate keys. Also renamed tdb_get_int() to tdb_fetch_int() to keep the set of verbs consistent. (This used to be commit a423c7c5f21dc4046530b85482dee88dcfcbf070)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index b23dd3aa73..0a2f494a27 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -76,7 +76,7 @@ BOOL print_backend_init(void)
/* handle a Samba upgrade */
tdb_writelock(tdb);
- if (tdb_get_int(tdb, "INFO/version") != PRINT_DATABASE_VERSION) {
+ if (tdb_fetch_int(tdb, "INFO/version") != PRINT_DATABASE_VERSION) {
tdb_traverse(tdb, (tdb_traverse_func)tdb_delete, NULL);
tdb_store_int(tdb, "INFO/version", PRINT_DATABASE_VERSION);
}
@@ -602,7 +602,7 @@ int print_job_start(int snum, char *jobname)
/* lock the database */
tdb_writelock(tdb);
- next_jobid = tdb_get_int(tdb, "INFO/nextjob");
+ next_jobid = tdb_fetch_int(tdb, "INFO/nextjob");
if (next_jobid == -1) next_jobid = 1;
for (jobid = next_jobid+1; jobid != next_jobid; ) {
@@ -723,7 +723,7 @@ static BOOL print_cache_expired(int snum)
fstring key;
time_t t2, t = time(NULL);
slprintf(key, sizeof(key), "CACHE/%s", lp_servicename(snum));
- t2 = tdb_get_int(tdb, key);
+ t2 = tdb_fetch_int(tdb, key);
if (t2 == ((time_t)-1) || (t - t2) >= lp_lpqcachetime()) {
return True;
}