Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
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);
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);