]> xenbits.xensource.com Git - xen.git/commitdiff
Fix for fs-backend crash when xend was not started after system boot.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 22 Feb 2010 10:06:21 +0000 (10:06 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 22 Feb 2010 10:06:21 +0000 (10:06 +0000)
Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
tools/fs-back/fs-backend.c
tools/fs-back/fs-xenbus.c

index 780a74465578ab10c473419d7f97e1d07b2c474f..e8882822ab980842e8951574ada01db89cc5a184 100644 (file)
@@ -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);
index e883b661a09f24ecb7d8347315058914642b26d1..70ddcbbf87e4efcecb9700e8783554ed4af7ff30 100644 (file)
@@ -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);