]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools/xenstore: Document failure for xs_{read,directory,read_watch}
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 5 Dec 2018 16:26:02 +0000 (16:26 +0000)
committerWei Liu <wei.liu2@citrix.com>
Fri, 7 Dec 2018 12:18:41 +0000 (12:18 +0000)
Those functions can return NULL on failure, document it in the public
header.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/xenstore/include/xenstore.h
tools/xenstore/xs.c

index 889dc2386351ed69a874355af095a4eba2eecb65..42b286646234dc3fb7cb75e2af7c3233d4f8b9f1 100644 (file)
@@ -103,6 +103,7 @@ void xs_daemon_destroy_postfork(struct xs_handle *);
 /* Get contents of a directory.
  * Returns a malloced array: call free() on it after use.
  * Num indicates size.
+ * Returns NULL on failure.
  */
 char **xs_directory(struct xs_handle *h, xs_transaction_t t,
                    const char *path, unsigned int *num);
@@ -110,6 +111,7 @@ char **xs_directory(struct xs_handle *h, xs_transaction_t t,
 /* Get the value of a single file, nul terminated.
  * Returns a malloced value: call free() on it after use.
  * len indicates length in bytes, not including terminator.
+ * Returns NULL on failure.
  */
 void *xs_read(struct xs_handle *h, xs_transaction_t t,
              const char *path, unsigned int *len);
@@ -196,8 +198,9 @@ int xs_fileno(struct xs_handle *h);
 char **xs_check_watch(struct xs_handle *h);
 
 /* Find out what node change was on (will block if nothing pending).
- * Returns array containing the path and token. Use XS_WATCH_* to access these
- * elements. Call free() after use.
+ * Returns array containing the path and token, or NULL.
+ * Use XS_WATCH_* to access these elements.
+ * Call free() after use.
  */
 char **xs_read_watch(struct xs_handle *h, unsigned int *num);
 
index 77700bff2bd264ea1385c047121b5aacc75fb12f..87e43bfe8706ac162685e5889793671c00f6cb2c 100644 (file)
@@ -680,6 +680,7 @@ char **xs_directory(struct xs_handle *h, xs_transaction_t t,
 /* Get the value of a single file, nul terminated.
  * Returns a malloced value: call free() on it after use.
  * len indicates length in bytes, not including the nul.
+ * Returns NULL on failure.
  */
 void *xs_read(struct xs_handle *h, xs_transaction_t t,
              const char *path, unsigned int *len)