From 41d02bc3852140b052a656c63abb7d78f1683aa9 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 22 Apr 2003 21:22:04 +0000 Subject: [PATCH] Some ioctl code tidying: removing duplicate internal buffers; making bounds checks clearer (incl. variable renaming); using a flag to indicate when output data doesn't fit into supplied buffer instead of returning an error etc. --- libdm/ioctl/libdevmapper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libdm/ioctl/libdevmapper.c b/libdm/ioctl/libdevmapper.c index 64ba1d8ba..a9e257897 100644 --- a/libdm/ioctl/libdevmapper.c +++ b/libdm/ioctl/libdevmapper.c @@ -471,7 +471,7 @@ void *dm_get_next_target(struct dm_task *dmt, void *next, /* Unmarshall the target info returned from a status call */ static int _unmarshal_status(struct dm_task *dmt, struct dm_ioctl *dmi) { - char *outbuf = (char *) dmi + dmi->data_start; + char *outbuf = (char *) dmi + dmi->data_offset; char *outptr = outbuf; uint32_t i; struct dm_target_spec *spec; @@ -528,7 +528,7 @@ struct dm_deps *dm_task_get_deps(struct dm_task *dmt) return _dm_task_get_deps_v1(dmt); return (struct dm_deps *) (((void *) dmt->dmi.v3) + - dmt->dmi.v3->data_start); + dmt->dmi.v3->data_offset); } int dm_task_set_ro(struct dm_task *dmt) @@ -663,7 +663,7 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt) dmi->version[2] = (*version)[2]; dmi->data_size = len; - dmi->data_start = sizeof(struct dm_ioctl); + dmi->data_offset = sizeof(struct dm_ioctl); if (dmt->dev_name) strncpy(dmi->name, dmt->dev_name, sizeof(dmi->name));