Replace NULL xenbus transaction by a specific XBT_NULL value.
authorvhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>
Tue, 10 Jan 2006 15:05:05 +0000 (15:05 +0000)
committervhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>
Tue, 10 Jan 2006 15:05:05 +0000 (15:05 +0000)
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
18 files changed:
linux-2.6-xen-sparse/arch/xen/kernel/smpboot.c
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
linux-2.6-xen-sparse/drivers/xen/net_driver_util.c
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
linux-2.6-xen-sparse/drivers/xen/tpmback/xenbus.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_client.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
linux-2.6-xen-sparse/include/asm-xen/xenbus.h
tools/console/client/main.c
tools/console/daemon/io.c
tools/xenstore/xs.c
tools/xenstore/xs.h
tools/xenstore/xs_test.c
tools/xenstore/xsls.c

index 8d9b1531c59d8ea988d1c8edd39a25aee7290225..196a4e3ec3e434ad0045fd6310ed1afd2a0fab61 100644 (file)
@@ -298,7 +298,7 @@ static void vcpu_hotplug(unsigned int cpu)
                return;
 
        sprintf(dir, "cpu/%d", cpu);
-       err = xenbus_scanf(NULL, dir, "availability", "%s", state);
+       err = xenbus_scanf(XBT_NULL, dir, "availability", "%s", state);
        if (err != 1) {
                printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
                return;
index 5ffd8a48faa03418202c41132b983077f1694ae2..7b6d08801653b753222d952adfadf4da245b7158 100644 (file)
@@ -354,7 +354,7 @@ static void watch_target(struct xenbus_watch *watch,
        unsigned long long new_target;
        int err;
 
-       err = xenbus_scanf(NULL, "memory", "target", "%llu", &new_target);
+       err = xenbus_scanf(XBT_NULL, "memory", "target", "%llu", &new_target);
        if (err != 1) {
                /* This is ok (for domain0 at least) - so just return */
                return;
index 100e984b09be859db71cebe69642d5eeb6591b38..2b2f40f2e6644f4e7548baf80f9c3c32ae98c38b 100644 (file)
@@ -145,7 +145,7 @@ static int blkback_probe(struct xenbus_device *dev,
        if (err)
                goto fail;
 
-       err = xenbus_switch_state(dev, NULL, XenbusStateInitWait);
+       err = xenbus_switch_state(dev, XBT_NULL, XenbusStateInitWait);
        if (err)
                goto fail;
 
@@ -175,7 +175,7 @@ static void backend_changed(struct xenbus_watch *watch,
 
        DPRINTK("");
 
-       err = xenbus_scanf(NULL, dev->nodename, "physical-device", "%x:%x",
+       err = xenbus_scanf(XBT_NULL, dev->nodename, "physical-device", "%x:%x",
                           &major, &minor);
        if (XENBUS_EXIST_ERR(err)) {
                /* Since this watch will fire once immediately after it is
@@ -197,7 +197,7 @@ static void backend_changed(struct xenbus_watch *watch,
                return;
        }
 
-       be->mode = xenbus_read(NULL, dev->nodename, "mode", NULL);
+       be->mode = xenbus_read(XBT_NULL, dev->nodename, "mode", NULL);
        if (IS_ERR(be->mode)) {
                err = PTR_ERR(be->mode);
                be->mode = NULL;
@@ -268,7 +268,7 @@ static void frontend_changed(struct xenbus_device *dev,
                break;
 
        case XenbusStateClosing:
-               xenbus_switch_state(dev, NULL, XenbusStateClosing);
+               xenbus_switch_state(dev, XBT_NULL, XenbusStateClosing);
                break;
 
        case XenbusStateClosed:
@@ -366,7 +366,7 @@ static int connect_ring(struct backend_info *be)
 
        DPRINTK("%s", dev->otherend);
 
-       err = xenbus_gather(NULL, dev->otherend, "ring-ref", "%lu", &ring_ref,
+       err = xenbus_gather(XBT_NULL, dev->otherend, "ring-ref", "%lu", &ring_ref,
                            "event-channel", "%u", &evtchn, NULL);
        if (err) {
                xenbus_dev_fatal(dev, err,
index 2ec97d1e0b262c07c8d8a526a20a70aefc9dbf9d..5bf408a9b8694c5138bb76a3c542b1badbe1c517 100644 (file)
@@ -91,7 +91,7 @@ static int blkfront_probe(struct xenbus_device *dev,
        struct blkfront_info *info;
 
        /* FIXME: Use dynamic device id if this is not set. */
-       err = xenbus_scanf(NULL, dev->nodename,
+       err = xenbus_scanf(XBT_NULL, dev->nodename,
                           "virtual-device", "%i", &vdevice);
        if (err != 1) {
                xenbus_dev_fatal(dev, err, "reading virtual-device");
@@ -319,7 +319,7 @@ static void connect(struct blkfront_info *info)
 
        DPRINTK("blkfront.c:connect:%s.\n", info->xbdev->otherend);
 
-       err = xenbus_gather(NULL, info->xbdev->otherend,
+       err = xenbus_gather(XBT_NULL, info->xbdev->otherend,
                            "sectors", "%lu", &sectors,
                            "info", "%u", &binfo,
                            "sector-size", "%lu", &sector_size,
@@ -338,7 +338,7 @@ static void connect(struct blkfront_info *info)
                return;
        }
 
-       (void)xenbus_switch_state(info->xbdev, NULL, XenbusStateConnected); 
+       (void)xenbus_switch_state(info->xbdev, XBT_NULL, XenbusStateConnected); 
 
        /* Kick pending requests. */
        spin_lock_irq(&blkif_io_lock);
@@ -367,7 +367,7 @@ static void blkfront_closing(struct xenbus_device *dev)
                info->mi = NULL;
        }
 
-       xenbus_switch_state(dev, NULL, XenbusStateClosed);
+       xenbus_switch_state(dev, XBT_NULL, XenbusStateClosed);
 }
 
 
@@ -775,7 +775,7 @@ static void blkif_recover(struct blkfront_info *info)
 
        kfree(copy);
 
-       (void)xenbus_switch_state(info->xbdev, NULL, XenbusStateConnected); 
+       (void)xenbus_switch_state(info->xbdev, XBT_NULL, XenbusStateConnected); 
        
        /* Now safe for us to use the shared ring */
        spin_lock_irq(&blkif_io_lock);
index c6fe4a3838b1acf1fc1e164298eee2dcb0cec8cc..8826b80ca875df3418cf572be054c0c0fd49cf4e 100644 (file)
@@ -38,7 +38,7 @@ int xen_net_read_mac(struct xenbus_device *dev, u8 mac[])
        char *s;
        int i;
        char *e;
-       char *macstr = xenbus_read(NULL, dev->nodename, "mac", NULL);
+       char *macstr = xenbus_read(XBT_NULL, dev->nodename, "mac", NULL);
        if (IS_ERR(macstr)) {
                return PTR_ERR(macstr);
        }
index 086c2ec5fb269a1ece6ab9aa7495a0e8a7b2c85e..9db90d2e5e42e3eae2c28d14a2e60aab1c665b3b 100644 (file)
@@ -93,7 +93,7 @@ static int netback_probe(struct xenbus_device *dev,
        if (err)
                goto fail;
 
-       err = xenbus_switch_state(dev, NULL, XenbusStateInitWait);
+       err = xenbus_switch_state(dev, XBT_NULL, XenbusStateInitWait);
        if (err) {
                goto fail;
        }
@@ -122,7 +122,7 @@ static int netback_hotplug(struct xenbus_device *xdev, char **envp,
 
        DPRINTK("netback_hotplug");
 
-       val = xenbus_read(NULL, xdev->nodename, "script", NULL);
+       val = xenbus_read(XBT_NULL, xdev->nodename, "script", NULL);
        if (IS_ERR(val)) {
                int err = PTR_ERR(val);
                xenbus_dev_fatal(xdev, err, "reading script");
@@ -160,7 +160,7 @@ static void backend_changed(struct xenbus_watch *watch,
 
        DPRINTK("");
 
-       err = xenbus_scanf(NULL, dev->nodename, "handle", "%li", &handle);
+       err = xenbus_scanf(XBT_NULL, dev->nodename, "handle", "%li", &handle);
        if (XENBUS_EXIST_ERR(err)) {
                /* Since this watch will fire once immediately after it is
                   registered, we expect this.  Ignore it, and wait for the
@@ -212,7 +212,7 @@ static void frontend_changed(struct xenbus_device *dev,
                break;
 
        case XenbusStateClosing:
-               xenbus_switch_state(dev, NULL, XenbusStateClosing);
+               xenbus_switch_state(dev, XBT_NULL, XenbusStateClosing);
                break;
 
        case XenbusStateClosed:
@@ -256,7 +256,7 @@ static void connect(struct backend_info *be)
                return;
        }
 
-       xenbus_switch_state(dev, NULL, XenbusStateConnected);
+       xenbus_switch_state(dev, XBT_NULL, XenbusStateConnected);
 }
 
 
@@ -269,7 +269,7 @@ static int connect_rings(struct backend_info *be)
 
        DPRINTK("");
 
-       err = xenbus_gather(NULL, dev->otherend,
+       err = xenbus_gather(XBT_NULL, dev->otherend,
                            "tx-ring-ref", "%lu", &tx_ring_ref,
                            "rx-ring-ref", "%lu", &rx_ring_ref,
                            "event-channel", "%u", &evtchn, NULL);
index 2acba6b21d58d671dd14aa7c587897b91e2d31c0..5c3e56335801114479274b3548a2209271bf03b9 100644 (file)
@@ -212,7 +212,7 @@ static int netfront_probe(struct xenbus_device *dev,
        struct netfront_info *info;
        unsigned int handle;
 
-       err = xenbus_scanf(NULL, dev->nodename, "handle", "%u", &handle);
+       err = xenbus_scanf(XBT_NULL, dev->nodename, "handle", "%u", &handle);
        if (err != 1) {
                xenbus_dev_fatal(dev, err, "reading handle");
                return err;
@@ -1199,7 +1199,7 @@ static void netfront_closing(struct xenbus_device *dev)
 
        close_netdev(info);
 
-       xenbus_switch_state(dev, NULL, XenbusStateClosed);
+       xenbus_switch_state(dev, XBT_NULL, XenbusStateClosed);
 }
 
 
index c1ce6f7a61d2209f4a8a915552632a523dc6b538..b5039adadc9852d23b495e057a2251c4dbc663ab 100644 (file)
@@ -275,7 +275,7 @@ static int connect_ring(struct backend_info *be)
        unsigned int evtchn;
        int err;
 
-       err = xenbus_gather(NULL, dev->otherend,
+       err = xenbus_gather(XBT_NULL, dev->otherend,
                            "ring-ref", "%lu", &ring_ref,
                            "event-channel", "%u", &evtchn, NULL);
        if (err) {
index 42b974f425645c45d1b008f8f30be80803484b1d..385419e134ed3e134b5e8acdd6f17b0a693d17cb 100644 (file)
@@ -152,7 +152,7 @@ void _dev_error(struct xenbus_device *dev, int err, const char *fmt,
                goto fail;
        }
 
-       if (xenbus_write(NULL, path_buffer, "error", printf_buffer) != 0) {
+       if (xenbus_write(XBT_NULL, path_buffer, "error", printf_buffer) != 0) {
                printk("xenbus: failed to write error node for %s (%s)\n",
                       dev->nodename, printf_buffer);
                goto fail;
@@ -187,7 +187,7 @@ void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt,
        _dev_error(dev, err, fmt, ap);
        va_end(ap);
        
-       xenbus_switch_state(dev, NULL, XenbusStateClosing);
+       xenbus_switch_state(dev, XBT_NULL, XenbusStateClosing);
 }
 EXPORT_SYMBOL(xenbus_dev_fatal);
 
@@ -223,7 +223,7 @@ XenbusState xenbus_read_driver_state(const char *path)
 {
        XenbusState result;
 
-       int err = xenbus_gather(NULL, path, "state", "%d", &result, NULL);
+       int err = xenbus_gather(XBT_NULL, path, "state", "%d", &result, NULL);
        if (err)
                result = XenbusStateClosed;
 
index 176d53ca7645b22f80f52af5c4c389ac1e04d699..7b267836da49d6cc59a5eecd6d1e967e03cb19f4 100644 (file)
@@ -115,7 +115,7 @@ static int frontend_bus_id(char bus_id[BUS_ID_SIZE], const char *nodename)
 static int read_otherend_details(struct xenbus_device *xendev,
                                 char *id_node, char *path_node)
 {
-       int err = xenbus_gather(NULL, xendev->nodename,
+       int err = xenbus_gather(XBT_NULL, xendev->nodename,
                                id_node, "%i", &xendev->otherend_id,
                                path_node, NULL, &xendev->otherend,
                                NULL);
@@ -126,7 +126,7 @@ static int read_otherend_details(struct xenbus_device *xendev,
                return err;
        }
        if (strlen(xendev->otherend) == 0 ||
-           !xenbus_exists(NULL, xendev->otherend, "")) {
+           !xenbus_exists(XBT_NULL, xendev->otherend, "")) {
                xenbus_dev_fatal(xendev, -ENOENT, "missing other end from %s",
                                 xendev->nodename);
                kfree(xendev->otherend);
@@ -200,14 +200,14 @@ static int backend_bus_id(char bus_id[BUS_ID_SIZE], const char *nodename)
 
        devid = strrchr(nodename, '/') + 1;
 
-       err = xenbus_gather(NULL, nodename, "frontend-id", "%i", &domid,
+       err = xenbus_gather(XBT_NULL, nodename, "frontend-id", "%i", &domid,
                            "frontend", NULL, &frontend,
                            NULL);
        if (err)
                return err;
        if (strlen(frontend) == 0)
                err = -ERANGE;
-       if (!err && !xenbus_exists(NULL, frontend, ""))
+       if (!err && !xenbus_exists(XBT_NULL, frontend, ""))
                err = -ENOENT;
 
        kfree(frontend);
@@ -373,7 +373,7 @@ static int xenbus_dev_probe(struct device *_dev)
        return 0;
 fail:
        xenbus_dev_error(dev, err, "xenbus_dev_probe on %s", dev->nodename);
-       xenbus_switch_state(dev, NULL, XenbusStateClosed);
+       xenbus_switch_state(dev, XBT_NULL, XenbusStateClosed);
        return -ENODEV;
        
 }
@@ -391,7 +391,7 @@ static int xenbus_dev_remove(struct device *_dev)
        if (drv->remove)
                drv->remove(dev);
 
-       xenbus_switch_state(dev, NULL, XenbusStateClosed);
+       xenbus_switch_state(dev, XBT_NULL, XenbusStateClosed);
        return 0;
 }
 
@@ -643,7 +643,7 @@ static int xenbus_probe_backend(const char *type, const char *domid)
        if (!nodename)
                return -ENOMEM;
 
-       dir = xenbus_directory(NULL, nodename, "", &dir_n);
+       dir = xenbus_directory(XBT_NULL, nodename, "", &dir_n);
        if (IS_ERR(dir)) {
                kfree(nodename);
                return PTR_ERR(dir);
@@ -666,7 +666,7 @@ static int xenbus_probe_device_type(struct xen_bus_type *bus, const char *type)
        unsigned int dir_n = 0;
        int i;
 
-       dir = xenbus_directory(NULL, bus->root, type, &dir_n);
+       dir = xenbus_directory(XBT_NULL, bus->root, type, &dir_n);
        if (IS_ERR(dir))
                return PTR_ERR(dir);
 
@@ -685,7 +685,7 @@ static int xenbus_probe_devices(struct xen_bus_type *bus)
        char **dir;
        unsigned int i, dir_n;
 
-       dir = xenbus_directory(NULL, bus->root, "", &dir_n);
+       dir = xenbus_directory(XBT_NULL, bus->root, "", &dir_n);
        if (IS_ERR(dir))
                return PTR_ERR(dir);
 
@@ -731,7 +731,7 @@ static void dev_changed(const char *node, struct xen_bus_type *bus)
        if (char_count(node, '/') < 2)
                return;
 
-       exists = xenbus_exists(NULL, node, "");
+       exists = xenbus_exists(XBT_NULL, node, "");
        if (!exists) {
                xenbus_cleanup_devices(node, &bus->bus);
                return;
index 177b0d623f12dd53e8d2a2e136ae0efd4bbaf289..b6435d704043f6656741cee81dc9ae77baf64296 100644 (file)
@@ -431,7 +431,7 @@ struct xenbus_transaction *xenbus_transaction_start(void)
 
        down_read(&xs_state.suspend_mutex);
 
-       id_str = xs_single(NULL, XS_TRANSACTION_START, "", NULL);
+       id_str = xs_single(XBT_NULL, XS_TRANSACTION_START, "", NULL);
        if (IS_ERR(id_str)) {
                up_read(&xs_state.suspend_mutex);
                return (struct xenbus_transaction *)id_str;
@@ -553,7 +553,7 @@ static int xs_watch(const char *path, const char *token)
        iov[1].iov_base = (void *)token;
        iov[1].iov_len = strlen(token) + 1;
 
-       return xs_error(xs_talkv(NULL, XS_WATCH, iov,
+       return xs_error(xs_talkv(XBT_NULL, XS_WATCH, iov,
                                 ARRAY_SIZE(iov), NULL));
 }
 
@@ -566,7 +566,7 @@ static int xs_unwatch(const char *path, const char *token)
        iov[1].iov_base = (char *)token;
        iov[1].iov_len = strlen(token) + 1;
 
-       return xs_error(xs_talkv(NULL, XS_UNWATCH, iov,
+       return xs_error(xs_talkv(XBT_NULL, XS_UNWATCH, iov,
                                 ARRAY_SIZE(iov), NULL));
 }
 
index 5c695b9388f053937c6e8d596fc374d48d8c7f4b..c7e3ac783447c2e2cd92ab8a7ca95dcc3371f397 100644 (file)
@@ -37,6 +37,8 @@
 #include <asm-xen/xen-public/io/xenbus.h>
 #include <asm-xen/xen-public/io/xs_wire.h>
 
+#define XBT_NULL NULL
+
 /* Register callback to watch this node. */
 struct xenbus_watch
 {
index 0760f0cb9cedd49cac7f282348a02a624c33c6df..f500a593adfa26082da0a2ae70b1760c7e4b0f57 100644 (file)
@@ -220,7 +220,7 @@ int main(int argc, char **argv)
        if (path == NULL)
                err(ENOMEM, "realloc");
        strcat(path, "/console/tty");
-       str_pty = xs_read(xs, NULL, path, &len);
+       str_pty = xs_read(xs, XBT_NULL, path, &len);
 
        /* FIXME consoled currently does not assume domain-0 doesn't have a
           console which is good when we break domain-0 up.  To keep us
@@ -245,7 +245,7 @@ int main(int argc, char **argv)
                struct timeval tv = { 0, 500 };
                select(0, NULL, NULL, NULL, &tv); /* pause briefly */
 
-               str_pty = xs_read(xs, NULL, path, &len);
+               str_pty = xs_read(xs, XBT_NULL, path, &len);
        }
 
        if (str_pty == NULL) {
index 4587c5f7db031ef4b2fa76c37c040cd303f04918..8b187e5e82f527fde9d5c0b7ed1e16b8ca215eb3 100644 (file)
@@ -174,7 +174,7 @@ static int domain_create_tty(struct domain *dom)
                success = asprintf(&path, "%s/limit", dom->conspath) != -1;
                if (!success)
                        goto out;
-               data = xs_read(xs, NULL, path, &len);
+               data = xs_read(xs, XBT_NULL, path, &len);
                if (data) {
                        dom->buffer.max_capacity = strtoul(data, 0, 0);
                        free(data);
@@ -184,7 +184,7 @@ static int domain_create_tty(struct domain *dom)
                success = asprintf(&path, "%s/tty", dom->conspath) != -1;
                if (!success)
                        goto out;
-               success = xs_write(xs, NULL, path, slave, strlen(slave));
+               success = xs_write(xs, XBT_NULL, path, slave, strlen(slave));
                free(path);
                if (!success)
                        goto out;
@@ -214,7 +214,7 @@ int xs_gather(struct xs_handle *xs, const char *dir, ...)
                char *p;
 
                asprintf(&path, "%s/%s", dir, name);
-               p = xs_read(xs, NULL, path, NULL);
+               p = xs_read(xs, XBT_NULL, path, NULL);
                free(path);
                if (p == NULL) {
                        ret = ENOENT;
index 5cd4201e2073d3a748a538dd635f72dac5da4683..b8d9e23e7c9f23e5b77ab18af1b9977906293919 100644 (file)
@@ -560,7 +560,7 @@ bool xs_watch(struct xs_handle *h, const char *path, const char *token)
        iov[1].iov_base = (void *)token;
        iov[1].iov_len = strlen(token) + 1;
 
-       return xs_bool(xs_talkv(h, NULL, XS_WATCH, iov,
+       return xs_bool(xs_talkv(h, XBT_NULL, XS_WATCH, iov,
                                ARRAY_SIZE(iov), NULL));
 }
 
@@ -627,7 +627,7 @@ bool xs_unwatch(struct xs_handle *h, const char *path, const char *token)
        iov[1].iov_base = (char *)token;
        iov[1].iov_len = strlen(token) + 1;
 
-       return xs_bool(xs_talkv(h, NULL, XS_UNWATCH, iov,
+       return xs_bool(xs_talkv(h, XBT_NULL, XS_UNWATCH, iov,
                                ARRAY_SIZE(iov), NULL));
 }
 
@@ -641,7 +641,7 @@ struct xs_transaction_handle *xs_transaction_start(struct xs_handle *h)
        char *id_str;
        unsigned long id;
 
-       id_str = xs_single(h, NULL, XS_TRANSACTION_START, "", NULL);
+       id_str = xs_single(h, XBT_NULL, XS_TRANSACTION_START, "", NULL);
        if (id_str == NULL)
                return NULL;
 
@@ -693,7 +693,7 @@ bool xs_introduce_domain(struct xs_handle *h,
        iov[2].iov_base = eventchn_str;
        iov[2].iov_len = strlen(eventchn_str) + 1;
 
-       return xs_bool(xs_talkv(h, NULL, XS_INTRODUCE, iov,
+       return xs_bool(xs_talkv(h, XBT_NULL, XS_INTRODUCE, iov,
                                ARRAY_SIZE(iov), NULL));
 }
 
@@ -705,7 +705,7 @@ static void * single_with_domid(struct xs_handle *h,
 
        sprintf(domid_str, "%u", domid);
 
-       return xs_single(h, NULL, type, domid_str, NULL);
+       return xs_single(h, XBT_NULL, type, domid_str, NULL);
 }
 
 bool xs_release_domain(struct xs_handle *h, unsigned int domid)
@@ -719,7 +719,7 @@ char *xs_get_domain_path(struct xs_handle *h, unsigned int domid)
 
        sprintf(domid_str, "%u", domid);
 
-       return xs_single(h, NULL, XS_GET_DOMAIN_PATH, domid_str, NULL);
+       return xs_single(h, XBT_NULL, XS_GET_DOMAIN_PATH, domid_str, NULL);
 }
 
 bool xs_is_domain_introduced(struct xs_handle *h, unsigned int domid)
@@ -739,7 +739,7 @@ char *xs_debug_command(struct xs_handle *h, const char *cmd,
        iov[1].iov_base = data;
        iov[1].iov_len = len;
 
-       return xs_talkv(h, NULL, XS_DEBUG, iov,
+       return xs_talkv(h, XBT_NULL, XS_DEBUG, iov,
                        ARRAY_SIZE(iov), NULL);
 }
 
index c86a8160074767ed017a6e632236d13180202bb6..0d0a8c8dd90eee831676f80e90441d7eedb5bae9 100644 (file)
@@ -22,6 +22,8 @@
 
 #include <xs_lib.h>
 
+#define XBT_NULL NULL
+
 struct xs_handle;
 struct xs_transaction_handle;
 
index 9c2ae925687bf483eb05acab84138745463bc7c7..09e04a8c62fe0169a53b6dc2225720f442765679 100644 (file)
 #include <sys/time.h>
 #include "utils.h"
 #include "xs_lib.h"
+#include "xs.h"
 #include "list.h"
 
 #define XSTEST
 
 static struct xs_handle *handles[10] = { NULL };
-static struct xs_transaction_handle *txh[10] = { NULL };
+static struct xs_transaction_handle *txh[10] = { XBT_NULL };
 
 static unsigned int timeout_ms = 500;
 static bool timeout_suppressed = true;
@@ -492,7 +493,7 @@ static void do_unwatch(unsigned int handle, const char *node, const char *token)
 static void do_start(unsigned int handle)
 {
        txh[handle] = xs_transaction_start(handles[handle]);
-       if (txh[handle] == NULL)
+       if (txh[handle] == XBT_NULL)
                failed(handle);
 }
 
@@ -500,7 +501,7 @@ static void do_end(unsigned int handle, bool abort)
 {
        if (!xs_transaction_end(handles[handle], txh[handle], abort))
                failed(handle);
-       txh[handle] = NULL;
+       txh[handle] = XBT_NULL;
 }
 
 static void do_introduce(unsigned int handle,
@@ -718,7 +719,7 @@ static void do_command(unsigned int default_handle, char *line)
        else if (streq(command, "close")) {
                xs_daemon_close(handles[handle]);
                handles[handle] = NULL;
-               txh[handle] = NULL;
+               txh[handle] = XBT_NULL;
        } else if (streq(command, "start"))
                do_start(handle);
        else if (streq(command, "commit"))
index 781fc6d7a8d0c9a848beaf4002184328338bfbe8..7f3fa4f7f1631637e73b942bea26c1d475e56e66 100644 (file)
@@ -11,7 +11,7 @@ void print_dir(struct xs_handle *h, char *path, int cur_depth)
     int i;
     unsigned int num, len;
 
-    e = xs_directory(h, NULL, path, &num);
+    e = xs_directory(h, XBT_NULL, path, &num);
     if (e == NULL)
         err(1, "xs_directory (%s)", path);
 
@@ -22,7 +22,7 @@ void print_dir(struct xs_handle *h, char *path, int cur_depth)
         sprintf(newpath, "%s%s%s", path, 
                 path[strlen(path)-1] == '/' ? "" : "/", 
                 e[i]);
-        val = xs_read(h, NULL, newpath, &len);
+        val = xs_read(h, XBT_NULL, newpath, &len);
         if (val == NULL)
             printf(":\n");
         else if ((unsigned)len > (151 - strlen(e[i])))