ia64/xen-unstable
changeset 8986:643940bb3e50
initialize few structure fully to zero with talloc_zero
instead of explicitely initializing some fields to NULL.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
instead of explicitely initializing some fields to NULL.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author | vhanquez@kneesa.uk.xensource.com |
---|---|
date | Thu Feb 23 17:14:55 2006 +0000 (2006-02-23) |
parents | b40aefd658c0 |
children | 436c4c83a200 |
files | tools/xenstore/xenstored_core.c |
line diff
1.1 --- a/tools/xenstore/xenstored_core.c Thu Feb 23 16:29:06 2006 +0000 1.2 +++ b/tools/xenstore/xenstored_core.c Thu Feb 23 17:14:55 2006 +0000 1.3 @@ -573,14 +573,11 @@ static struct buffered_data *new_buffer( 1.4 { 1.5 struct buffered_data *data; 1.6 1.7 - data = talloc(ctx, struct buffered_data); 1.8 + data = talloc_zero(ctx, struct buffered_data); 1.9 if (data == NULL) 1.10 return NULL; 1.11 1.12 data->inhdr = true; 1.13 - data->used = 0; 1.14 - data->buffer = NULL; 1.15 - 1.16 return data; 1.17 } 1.18 1.19 @@ -1394,17 +1391,13 @@ static void manual_node(const char *name 1.20 struct node *node; 1.21 struct xs_permissions perms = { .id = 0, .perms = XS_PERM_NONE }; 1.22 1.23 - node = talloc(NULL, struct node); 1.24 + node = talloc_zero(NULL, struct node); 1.25 node->name = name; 1.26 node->perms = &perms; 1.27 node->num_perms = 1; 1.28 - node->data = NULL; 1.29 - node->datalen = 0; 1.30 node->children = (char *)child; 1.31 if (child) 1.32 node->childlen = strlen(child) + 1; 1.33 - else 1.34 - node->childlen = 0; 1.35 1.36 if (!write_node(NULL, node)) 1.37 barf_perror("Could not create initial node %s", name);