[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] tools/xenstore: Document failure for xs_{read, directory, read_watch}



commit 42c09149c64d282b3daf67b10a1e08579320b2ec
Author:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
AuthorDate: Wed Dec 5 16:26:02 2018 +0000
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Fri Dec 7 12:18:41 2018 +0000

    tools/xenstore: Document failure for xs_{read,directory,read_watch}
    
    Those functions can return NULL on failure, document it in the public
    header.
    
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/xenstore/include/xenstore.h | 7 +++++--
 tools/xenstore/xs.c               | 1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/xenstore/include/xenstore.h 
b/tools/xenstore/include/xenstore.h
index 889dc23863..42b2866462 100644
--- a/tools/xenstore/include/xenstore.h
+++ b/tools/xenstore/include/xenstore.h
@@ -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);
 
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 77700bff2b..87e43bfe87 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -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)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.