int fd;
fd=open("/dev/null",O_RDONLY);
- g_return_val_if_fail(fd!=-1,-1);
+ /* We may be already chroot()ed.
+ * We would be called from captive_storage_relastblock()
+ * and it is safe to return -1 in such case.
+ */
+ if (fd==-1)
+ return -1;
iochannel_null=g_io_channel_unix_new(fd);
g_return_val_if_fail(iochannel_null!=NULL,-1);
}