aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_core.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-05-23 09:35:23 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-05-23 09:35:23 +0100
commit8543c562dd5553e92bb65cf27409551bc795ed52 (patch)
treef3d93e7e4b042913dbbf3d101d28ceb75c3ba9c0 /tools/libxc/xc_core.c
parent45ea54341290b85554730bdf71d96a27e02c1b26 (diff)
downloadxen-8543c562dd5553e92bb65cf27409551bc795ed52.tar.gz
xen-8543c562dd5553e92bb65cf27409551bc795ed52.tar.bz2
xen-8543c562dd5553e92bb65cf27409551bc795ed52.zip
stubdom: complete libxc support
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_core.c')
-rw-r--r--tools/libxc/xc_core.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c
index a4327101b6..864380d03d 100644
--- a/tools/libxc/xc_core.c
+++ b/tools/libxc/xc_core.c
@@ -64,7 +64,7 @@
/* string table */
struct xc_core_strtab {
char *strings;
- uint16_t current;
+ uint16_t length;
uint16_t max;
};
@@ -89,7 +89,7 @@ xc_core_strtab_init(void)
/* index 0 represents none */
strtab->strings[0] = '\0';
- strtab->current = 1;
+ strtab->length = 1;
return strtab;
}
@@ -107,14 +107,14 @@ xc_core_strtab_get(struct xc_core_strtab *strtab, const char *name)
uint16_t ret = 0;
uint16_t len = strlen(name) + 1;
- if ( strtab->current > UINT16_MAX - len )
+ if ( strtab->length > UINT16_MAX - len )
{
PERROR("too long string table");
errno = E2BIG;
return ret;
}
- if ( strtab->current + len > strtab->max )
+ if ( strtab->length + len > strtab->max )
{
char *tmp;
if ( strtab->max > UINT16_MAX / 2 )
@@ -135,9 +135,9 @@ xc_core_strtab_get(struct xc_core_strtab *strtab, const char *name)
strtab->max *= 2;
}
- ret = strtab->current;
- strcpy(strtab->strings + strtab->current, name);
- strtab->current += len;
+ ret = strtab->length;
+ strcpy(strtab->strings + strtab->length, name);
+ strtab->length += len;
return ret;
}
@@ -669,7 +669,7 @@ xc_domain_dumpcore_via_callback(int xc_handle,
offset += filesz;
/* fixing up section header string table section header */
- filesz = strtab->current;
+ filesz = strtab->length;
sheaders->shdrs[strtab_idx].sh_offset = offset;
sheaders->shdrs[strtab_idx].sh_size = filesz;
@@ -829,7 +829,7 @@ copy_done:
goto out;
/* elf section header string table: .shstrtab */
- sts = dump_rtn(args, strtab->strings, strtab->current);
+ sts = dump_rtn(args, strtab->strings, strtab->length);
if ( sts != 0 )
goto out;