xenstore: expanding_buffer variables are supposed to be static. Apart
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 5 Dec 2007 17:56:13 +0000 (17:56 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 5 Dec 2007 17:56:13 +0000 (17:56 +0000)
from anything else, this was guaranteeing they were initialised.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/xenstore/xenstore_client.c

index 0f36356233820fb944eef784df9bd8b6c0ed6eee..e4c18ae8e974d2264cbbc36e9772ccf82fee4483 100644 (file)
@@ -138,7 +138,7 @@ perform(int optind, int argc, char **argv, struct xs_handle *xsh,
 {
     while (optind < argc) {
 #if defined(CLIENT_read)
-       struct expanding_buffer ebuf;
+       static struct expanding_buffer ebuf;
        unsigned len;
        char *val = xs_read(xsh, xth, argv[optind], &len);
        if (val == NULL) {
@@ -151,7 +151,7 @@ perform(int optind, int argc, char **argv, struct xs_handle *xsh,
        free(val);
        optind++;
 #elif defined(CLIENT_write)
-       struct expanding_buffer ebuf;
+       static struct expanding_buffer ebuf;
        char *val_spec = argv[optind + 1];
        unsigned len;
        expanding_buffer_ensure(&ebuf, strlen(val_spec)+1);