1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-10 05:18:36 +03:00

more little fixes

This commit is contained in:
Alasdair Kergon 2007-01-16 21:13:07 +00:00
parent 9268d92c70
commit 392e1bc2e8
4 changed files with 10 additions and 7 deletions

View File

@ -246,7 +246,7 @@ static void _free_dso_data(struct dso_data *data)
*/
/* FIXME? move to libdevmapper to share with the client lib (need to
make delimiter a parameter then) */
static int _fetch_string(char **ptr, char **src, const char delimiter)
static int _fetch_string(char **ptr, char **src, const int delimiter)
{
int ret = 0;
char *p;

View File

@ -262,6 +262,7 @@ static int _daemon_talk(struct dm_event_fifos *fifos,
const char *dso = dso_name ? dso_name : "";
const char *dev = dev_name ? dev_name : "";
const char *fmt = "%s %s %u %" PRIu32;
int msg_size;
memset(msg, 0, sizeof(*msg));
/*
@ -269,10 +270,12 @@ static int _daemon_talk(struct dm_event_fifos *fifos,
* into ASCII message string.
*/
msg->cmd = cmd;
if ((msg->size = dm_asprintf(&(msg->data), fmt, dso, dev, evmask,
if ((msg_size = dm_asprintf(&(msg->data), fmt, dso, dev, evmask,
timeout)) < 0) {
log_error("_daemon_talk: message allocation failed");
return -ENOMEM;
}
msg->size = msg_size;
/*
* Write command and message to and
@ -535,7 +538,7 @@ int dm_event_unregister_handler(const struct dm_event_handler *dmevh)
/* Fetch a string off src and duplicate it into *dest. */
/* FIXME: move to separate module to share with the daemon. */
static char *_fetch_string(char **src, const char delimiter)
static char *_fetch_string(char **src, const int delimiter)
{
char *p, *ret;

View File

@ -60,7 +60,7 @@ struct field_properties {
struct list list;
uint32_t field_num;
uint32_t sort_posn;
int width;
unsigned width;
const struct dm_report_object_type *type;
uint32_t flags;
};
@ -667,7 +667,7 @@ static int _row_compare(const void *a, const void *b)
const struct row *rowa = *(const struct row **) a;
const struct row *rowb = *(const struct row **) b;
const struct dm_report_field *sfa, *sfb;
int32_t cnt = -1;
uint32_t cnt;
for (cnt = 0; cnt < rowa->rh->keys_count; cnt++) {
sfa = (*rowa->sort_fields)[cnt];
@ -739,7 +739,7 @@ int dm_report_output(struct dm_report *rh)
struct dm_report_field *field;
const char *repstr;
char buf[4096];
int width;
unsigned width;
if (list_empty(&rh->rows))
return 1;

View File

@ -1673,7 +1673,7 @@ static char *parse_loop_device_name(char *dev)
char *buf;
char *device;
if (!(buf = dm_malloc(PATH_MAX)));
if (!(buf = dm_malloc(PATH_MAX)))
return NULL;
if (dev[0] == '/') {