git://git.jankratochvil.net
/
captive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
869c77b
)
Fixed captive_storage_relastblock() invoked in sandbox slave.
author
short
<>
Sat, 6 Dec 2003 23:17:26 +0000
(23:17 +0000)
committer
short
<>
Sat, 6 Dec 2003 23:17:26 +0000
(23:17 +0000)
src/libcaptive/storage/iounixchannel.c
patch
|
blob
|
history
diff --git
a/src/libcaptive/storage/iounixchannel.c
b/src/libcaptive/storage/iounixchannel.c
index
1bf3f6a
..
df104b8
100644
(file)
--- a/
src/libcaptive/storage/iounixchannel.c
+++ b/
src/libcaptive/storage/iounixchannel.c
@@
-39,7
+39,12
@@
int r;
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);
}