diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-02-22 10:06:21 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-02-22 10:06:21 +0000 |
commit | d900060b28494579a305bc43b3ccb4654726a050 (patch) | |
tree | ec3de7cce07342925744828492e4e5039df09291 /tools | |
parent | 414391cea6310ad6e3221ccb76ae463509d43135 (diff) | |
download | xen-d900060b28494579a305bc43b3ccb4654726a050.tar.gz xen-d900060b28494579a305bc43b3ccb4654726a050.tar.bz2 xen-d900060b28494579a305bc43b3ccb4654726a050.zip |
Fix for fs-backend crash when xend was not started after system boot.
Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Diffstat (limited to 'tools')
-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); |