Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:Update
xen.5853
0001-xenstore-let-write_node-and-some-callers-r...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-xenstore-let-write_node-and-some-callers-return-errn.patch of Package xen.5853
References: bsc#1022555 From cf4b07a883cb5919112fd9adfc29f5550e488168 Mon Sep 17 00:00:00 2001 From: Juergen Gross <jgross@suse.com> Date: Wed, 15 Mar 2017 13:10:11 +0100 Subject: [PATCH 1/3] xenstore: let write_node() and some callers return errno Instead of setting errno and returning true or false return the error value directly. In order to ensure all call sites have been changed according to the modification rename the functions to xs_*. Signed-off-by: Juergen Gross <jgross@suse.com> --- tools/xenstore/xenstored_core.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) Index: xen-4.5.5-testing/tools/xenstore/xenstored_core.c =================================================================== --- xen-4.5.5-testing.orig/tools/xenstore/xenstored_core.c +++ xen-4.5.5-testing/tools/xenstore/xenstored_core.c @@ -434,7 +434,7 @@ static struct node *read_node(struct con return node; } -static bool write_node(struct connection *conn, struct node *node) +static int xs_write_node(struct connection *conn, struct node *node) { /* * conn will be null when this is called from manual_node. @@ -475,10 +475,10 @@ static bool write_node(struct connection corrupt(conn, "Write of %s failed", key.dptr); goto error; } - return true; + return 0; error: errno = ENOSPC; - return false; + return errno; } static enum xs_perm_type perm_for_conn(struct connection *conn, @@ -1018,7 +1018,7 @@ static struct node *create_node(struct c /* We write out the nodes down, setting destructor in case * something goes wrong. */ for (i = node; i; i = i->parent) { - if (!write_node(conn, i)) { + if (xs_write_node(conn, i)) { domain_entry_dec(conn, i); return NULL; } @@ -1058,7 +1058,7 @@ static int do_write(struct connection *c } else { node->data = in->buffer + offset; node->datalen = datalen; - if (!write_node(conn, node)) + if (xs_write_node(conn, node)) return errno; } @@ -1131,28 +1131,28 @@ static void memdel(void *mem, unsigned o } -static bool remove_child_entry(struct connection *conn, struct node *node, - size_t offset) +static int xs_remove_child_entry(struct connection *conn, struct node *node, + size_t offset) { size_t childlen = strlen(node->children + offset); memdel(node->children, offset, childlen + 1, node->childlen); node->childlen -= childlen + 1; - return write_node(conn, node); + return xs_write_node(conn, node); } -static bool delete_child(struct connection *conn, - struct node *node, const char *childname) +static int xs_delete_child(struct connection *conn, + struct node *node, const char *childname) { unsigned int i; for (i = 0; i < node->childlen; i += strlen(node->children+i) + 1) { if (streq(node->children+i, childname)) { - return remove_child_entry(conn, node, i); + return xs_remove_child_entry(conn, node, i); } } corrupt(conn, "Can't find child '%s' in %s", childname, node->name); - return false; + return ENOENT; } @@ -1172,7 +1172,7 @@ static int _rm(struct connection *conn, if (!parent) return (errno == ENOMEM) ? ENOMEM : EINVAL; - if (!delete_child(conn, parent, basename(name))) + if (xs_delete_child(conn, parent, basename(name))) return EINVAL; delete_node(conn, node, true); @@ -1276,7 +1276,7 @@ static int do_set_perms(struct connectio node->num_perms = num; domain_entry_inc(conn, node); - if (!write_node(conn, node)) + if (xs_write_node(conn, node)) return errno; wrl_apply_debit_direct(conn); @@ -1538,7 +1538,7 @@ static void manual_node(const char *name if (child) node->childlen = strlen(child) + 1; - if (!write_node(NULL, node)) + if (xs_write_node(NULL, node)) barf_perror("Could not create initial node %s", name); talloc_free(node); } @@ -1677,7 +1677,7 @@ static int check_store_(const char *name childname); if (recovery) { - remove_child_entry(NULL, node, + xs_remove_child_entry(NULL, node, i); i -= childlen + 1; } @@ -1699,7 +1699,7 @@ static int check_store_(const char *name childname); if (recovery) { - remove_child_entry(NULL, node, i); + xs_remove_child_entry(NULL, node, i); i -= childlen + 1; } } else {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor