diff options
-rw-r--r-- | tools/fs-back/fs-backend.c | 3 | ||||
-rw-r--r-- | tools/fs-back/fs-xenbus.c | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tools/fs-back/fs-backend.c b/tools/fs-back/fs-backend.c index 780a744655..e8882822ab 100644 --- a/tools/fs-back/fs-backend.c +++ b/tools/fs-back/fs-backend.c @@ -300,7 +300,8 @@ static void await_connections(void) LIST_INIT (&mount_requests_head); assert(xsh != NULL); - fd = xenbus_get_watch_fd(); + if ((fd = xenbus_get_watch_fd()) == -1) + err(1, "xenbus_get_watch_fd: could not setup watch"); /* Infinite watch loop */ do { FD_ZERO(&fds); diff --git a/tools/fs-back/fs-xenbus.c b/tools/fs-back/fs-xenbus.c index e883b661a0..70ddcbbf87 100644 --- a/tools/fs-back/fs-xenbus.c +++ b/tools/fs-back/fs-xenbus.c @@ -105,11 +105,18 @@ error_exit: int xenbus_get_watch_fd(void) { int res; +#if DEBUG + int errno_orig; +#endif assert(xsh != NULL); res = xs_watch(xsh, WATCH_NODE, "conn-watch"); if (!res) { +#if DEBUG + errno_orig = errno; FS_DEBUG("ERROR: xs_watch %s failed ret=%d errno=%d\n", WATCH_NODE, res, errno); + errno = errno_orig; +#endif return -1; } return xs_fileno(xsh); |