mirror of
https://github.com/samba-team/samba.git
synced 2025-02-25 17:57:42 +03:00
tdb:common/open.c - use "discard_const_p" for certain "tdb->name" assignments
In order to suppress compiler warnings.
This commit is contained in:
parent
eaac277381
commit
989d8803f2
@ -202,7 +202,7 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
tdb->name = "__NULL__";
|
tdb->name = discard_const_p(char, "__NULL__");
|
||||||
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: called with name == NULL\n"));
|
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: called with name == NULL\n"));
|
||||||
tdb->name = NULL;
|
tdb->name = NULL;
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
@ -215,7 +215,7 @@ _PUBLIC_ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int td
|
|||||||
* set the name as the given string, so that tdb_name() will
|
* set the name as the given string, so that tdb_name() will
|
||||||
* work in case of an error.
|
* work in case of an error.
|
||||||
*/
|
*/
|
||||||
tdb->name = name;
|
tdb->name = discard_const_p(char, name);
|
||||||
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: can't strdup(%s)\n",
|
TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: can't strdup(%s)\n",
|
||||||
name));
|
name));
|
||||||
tdb->name = NULL;
|
tdb->name = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user