mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
Rename ctdb_control_get_stat_history() local variable to avoid shadowing.
Local variable stat generates a warning because it shadows a global declatation, presumably stat(2). Rename it to s. This is in the context of wanting to run CCAN-style tests where most of the ctdbd code is just included in the test program. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit d17efacb3aa6fac61d89f4c88ca17579341c335f)
This commit is contained in:
parent
13653d47a2
commit
a2ba5342f5
@ -59,21 +59,21 @@ int32_t ctdb_control_get_stat_history(struct ctdb_context *ctdb,
|
||||
TDB_DATA *outdata)
|
||||
{
|
||||
int len;
|
||||
struct ctdb_statistics_wire *stat;
|
||||
struct ctdb_statistics_wire *s;
|
||||
|
||||
len = offsetof(struct ctdb_statistics_wire, stats) + MAX_STAT_HISTORY*sizeof(struct ctdb_statistics);
|
||||
|
||||
stat = talloc_size(outdata, len);
|
||||
if (stat == NULL) {
|
||||
s = talloc_size(outdata, len);
|
||||
if (s == NULL) {
|
||||
DEBUG(DEBUG_ERR,(__location__ " Failed to allocate statistics history structure\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
stat->num = MAX_STAT_HISTORY;
|
||||
memcpy(&stat->stats[0], &ctdb->statistics_history[0], sizeof(ctdb->statistics_history));
|
||||
s->num = MAX_STAT_HISTORY;
|
||||
memcpy(&s->stats[0], &ctdb->statistics_history[0], sizeof(ctdb->statistics_history));
|
||||
|
||||
outdata->dsize = len;
|
||||
outdata->dptr = (uint8_t *)stat;
|
||||
outdata->dptr = (uint8_t *)s;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user