summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-03-27 11:20:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:57 -0500
commit2d118cef3fe16c69cd290642c0aeadd303441a2d (patch)
tree4b7e942b35b6ff5711d5da3e9f29969b74f117b1 /source3
parenta806037b8713cdf0ae32f7091f53819393132a0b (diff)
downloadsamba-2d118cef3fe16c69cd290642c0aeadd303441a2d.tar.gz
samba-2d118cef3fe16c69cd290642c0aeadd303441a2d.tar.bz2
samba-2d118cef3fe16c69cd290642c0aeadd303441a2d.zip
r21988: make use of string_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand" metze (This used to be commit 2f52df71039befff8646aa67c1123df7be3591d2)
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/printing.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 39efe19604..5aac04aa8d 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -867,8 +867,7 @@ static pid_t get_updating_pid(const char *sharename)
if (!pdb)
return (pid_t)-1;
slprintf(keystr, sizeof(keystr)-1, "UPDATING/%s", sharename);
- key.dptr = keystr;
- key.dsize = strlen(keystr);
+ key = string_tdb_data(keystr);
data = tdb_fetch(pdb->tdb, key);
release_print_db(pdb);
@@ -905,8 +904,7 @@ static void set_updating_pid(const fstring sharename, BOOL updating)
return;
slprintf(keystr, sizeof(keystr)-1, "UPDATING/%s", sharename);
- key.dptr = keystr;
- key.dsize = strlen(keystr);
+ key = string_tdb_data(keystr);
DEBUG(5, ("set_updating_pid: %s updating lpq cache for print share %s\n",
updating ? "" : "not ",
@@ -1233,8 +1231,7 @@ static void print_queue_update_internal( const char *sharename,
/* store the new queue status structure */
slprintf(keystr, sizeof(keystr)-1, "STATUS/%s", sharename);
- key.dptr = keystr;
- key.dsize = strlen(keystr);
+ key = string_tdb_data(keystr);
status.qcount = qcount;
data.dptr = (char *)&status;
@@ -2701,8 +2698,8 @@ int print_queue_status(int snum,
ZERO_STRUCTP(status);
slprintf(keystr, sizeof(keystr)-1, "STATUS/%s", sharename);
- key.dptr = keystr;
- key.dsize = strlen(keystr);
+ key = string_tdb_data(keystr);
+
data = tdb_fetch(pdb->tdb, key);
if (data.dptr) {
if (data.dsize == sizeof(*status)) {