mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
r21988: make use of string_tdb_data()
to avoid creating the TDB_DATA struct from strings "by hand" metze
This commit is contained in:
parent
724c6fa337
commit
2f52df7103
@ -867,8 +867,7 @@ static pid_t get_updating_pid(const char *sharename)
|
|||||||
if (!pdb)
|
if (!pdb)
|
||||||
return (pid_t)-1;
|
return (pid_t)-1;
|
||||||
slprintf(keystr, sizeof(keystr)-1, "UPDATING/%s", sharename);
|
slprintf(keystr, sizeof(keystr)-1, "UPDATING/%s", sharename);
|
||||||
key.dptr = keystr;
|
key = string_tdb_data(keystr);
|
||||||
key.dsize = strlen(keystr);
|
|
||||||
|
|
||||||
data = tdb_fetch(pdb->tdb, key);
|
data = tdb_fetch(pdb->tdb, key);
|
||||||
release_print_db(pdb);
|
release_print_db(pdb);
|
||||||
@ -905,8 +904,7 @@ static void set_updating_pid(const fstring sharename, BOOL updating)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
slprintf(keystr, sizeof(keystr)-1, "UPDATING/%s", sharename);
|
slprintf(keystr, sizeof(keystr)-1, "UPDATING/%s", sharename);
|
||||||
key.dptr = keystr;
|
key = string_tdb_data(keystr);
|
||||||
key.dsize = strlen(keystr);
|
|
||||||
|
|
||||||
DEBUG(5, ("set_updating_pid: %s updating lpq cache for print share %s\n",
|
DEBUG(5, ("set_updating_pid: %s updating lpq cache for print share %s\n",
|
||||||
updating ? "" : "not ",
|
updating ? "" : "not ",
|
||||||
@ -1233,8 +1231,7 @@ static void print_queue_update_internal( const char *sharename,
|
|||||||
|
|
||||||
/* store the new queue status structure */
|
/* store the new queue status structure */
|
||||||
slprintf(keystr, sizeof(keystr)-1, "STATUS/%s", sharename);
|
slprintf(keystr, sizeof(keystr)-1, "STATUS/%s", sharename);
|
||||||
key.dptr = keystr;
|
key = string_tdb_data(keystr);
|
||||||
key.dsize = strlen(keystr);
|
|
||||||
|
|
||||||
status.qcount = qcount;
|
status.qcount = qcount;
|
||||||
data.dptr = (char *)&status;
|
data.dptr = (char *)&status;
|
||||||
@ -2701,8 +2698,8 @@ int print_queue_status(int snum,
|
|||||||
|
|
||||||
ZERO_STRUCTP(status);
|
ZERO_STRUCTP(status);
|
||||||
slprintf(keystr, sizeof(keystr)-1, "STATUS/%s", sharename);
|
slprintf(keystr, sizeof(keystr)-1, "STATUS/%s", sharename);
|
||||||
key.dptr = keystr;
|
key = string_tdb_data(keystr);
|
||||||
key.dsize = strlen(keystr);
|
|
||||||
data = tdb_fetch(pdb->tdb, key);
|
data = tdb_fetch(pdb->tdb, key);
|
||||||
if (data.dptr) {
|
if (data.dptr) {
|
||||||
if (data.dsize == sizeof(*status)) {
|
if (data.dsize == sizeof(*status)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user