mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
lib: Make gencache_pull_timeout look at uint8_t
At this point we're still looking at TDB_DATA. This patch moves the casts to a more appropriate place. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
1ff902fc32
commit
6797014d45
@ -423,7 +423,7 @@ bool gencache_del(const char *keystr)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gencache_pull_timeout(char *val, time_t *pres, char **pendptr)
|
static bool gencache_pull_timeout(uint8_t *val, time_t *pres, char **pendptr)
|
||||||
{
|
{
|
||||||
time_t res;
|
time_t res;
|
||||||
char *endptr;
|
char *endptr;
|
||||||
@ -432,10 +432,10 @@ static bool gencache_pull_timeout(char *val, time_t *pres, char **pendptr)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = strtol(val, &endptr, 10);
|
res = strtol((char *)val, &endptr, 10);
|
||||||
|
|
||||||
if ((endptr == NULL) || (*endptr != '/')) {
|
if ((endptr == NULL) || (*endptr != '/')) {
|
||||||
DEBUG(2, ("Invalid gencache data format: %s\n", val));
|
DEBUG(2, ("Invalid gencache data format: %s\n", (char *)val));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (pres != NULL) {
|
if (pres != NULL) {
|
||||||
@ -463,7 +463,7 @@ static int gencache_parse_fn(TDB_DATA key, TDB_DATA data, void *private_data)
|
|||||||
if (data.dptr == NULL) {
|
if (data.dptr == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ret = gencache_pull_timeout((char *)data.dptr, &t, &endptr);
|
ret = gencache_pull_timeout(data.dptr, &t, &endptr);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -706,7 +706,7 @@ static int stabilize_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA val,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gencache_pull_timeout((char *)val.dptr, &timeout, NULL)) {
|
if (!gencache_pull_timeout(val.dptr, &timeout, NULL)) {
|
||||||
DEBUG(10, ("Ignoring invalid entry\n"));
|
DEBUG(10, ("Ignoring invalid entry\n"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -745,7 +745,7 @@ static int wipe_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA val,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = gencache_pull_timeout((char *)val.dptr, &timeout, NULL);
|
ok = gencache_pull_timeout(val.dptr, &timeout, NULL);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
DEBUG(10, ("Ignoring invalid entry\n"));
|
DEBUG(10, ("Ignoring invalid entry\n"));
|
||||||
return 0;
|
return 0;
|
||||||
@ -860,7 +860,7 @@ static int gencache_iterate_blobs_fn(struct tdb_context *tdb, TDB_DATA key,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gencache_pull_timeout((char *)data.dptr, &timeout, &endptr)) {
|
if (!gencache_pull_timeout(data.dptr, &timeout, &endptr)) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
endptr += 1;
|
endptr += 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user