aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore
diff options
context:
space:
mode:
Diffstat (limited to 'tools/xenstore')
-rw-r--r--tools/xenstore/xenstore_client.c2
-rw-r--r--tools/xenstore/xs.c10
-rw-r--r--tools/xenstore/xs.h5
3 files changed, 8 insertions, 9 deletions
diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
index deb63453d3..07809e6c83 100644
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -243,7 +243,7 @@ main(int argc, char **argv)
again:
xth = xs_transaction_start(xsh);
- if (xth == NULL)
+ if (xth == XBT_NULL)
errx(1, "couldn't start transaction");
ret = perform(optind, argc, argv, xsh, xth, prefix, tidy);
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 8332e1aad5..f7a576119f 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -304,7 +304,7 @@ static void *xs_talkv(struct xs_handle *h, xs_transaction_t t,
unsigned int i;
struct sigaction ignorepipe, oldact;
- msg.tx_id = (uint32_t)(unsigned long)t;
+ msg.tx_id = t;
msg.req_id = 0;
msg.type = type;
msg.len = 0;
@@ -634,21 +634,21 @@ bool xs_unwatch(struct xs_handle *h, const char *path, const char *token)
/* Start a transaction: changes by others will not be seen during this
* transaction, and changes will not be visible to others until end.
* You can only have one transaction at any time.
- * Returns NULL on failure.
+ * Returns XBT_NULL on failure.
*/
xs_transaction_t xs_transaction_start(struct xs_handle *h)
{
char *id_str;
- unsigned long id;
+ xs_transaction_t id;
id_str = xs_single(h, XBT_NULL, XS_TRANSACTION_START, "", NULL);
if (id_str == NULL)
- return NULL;
+ return XBT_NULL;
id = strtoul(id_str, NULL, 0);
free(id_str);
- return (xs_transaction_t)id;
+ return id;
}
/* End a transaction.
diff --git a/tools/xenstore/xs.h b/tools/xenstore/xs.h
index 55bbcd157a..cabf9d0711 100644
--- a/tools/xenstore/xs.h
+++ b/tools/xenstore/xs.h
@@ -22,11 +22,10 @@
#include <xs_lib.h>
-#define XBT_NULL NULL
+#define XBT_NULL 0
struct xs_handle;
-struct xs_transaction_t;
-typedef struct xs_transaction_t * xs_transaction_t;
+typedef uint32_t xs_transaction_t;
/* On failure, these routines set errno. */