* fhandler_nodevice.cc (fhandler_nodevice::open): Convert EROFS to
ENOENT if non-existent file got opened for reading only. Explain why. * path.cc (path_conv::check): Stick to ENOENT if file has been opened for informational purposes only. Add to comment.
This commit is contained in:
parent
ce508e512a
commit
ffcd2c3f89
@ -1,3 +1,10 @@
|
|||||||
|
2012-04-04 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler_nodevice.cc (fhandler_nodevice::open): Convert EROFS to
|
||||||
|
ENOENT if non-existent file got opened for reading only. Explain why.
|
||||||
|
* path.cc (path_conv::check): Stick to ENOENT if file has been opened
|
||||||
|
for informational purposes only. Add to comment.
|
||||||
|
|
||||||
2012-04-04 Corinna Vinschen <corinna@vinschen.de>
|
2012-04-04 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* path.cc (path_conv::check): Convert device type to FH_FS for
|
* path.cc (path_conv::check): Convert device type to FH_FS for
|
||||||
|
@ -15,10 +15,14 @@ details. */
|
|||||||
#include "fhandler.h"
|
#include "fhandler.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
fhandler_nodevice::open (int, mode_t)
|
fhandler_nodevice::open (int flags, mode_t)
|
||||||
{
|
{
|
||||||
if (!pc.error)
|
if (!pc.error)
|
||||||
set_errno (ENXIO);
|
set_errno (ENXIO);
|
||||||
|
/* Fixup EROFS error returned from path_conv if /dev is not backed by real
|
||||||
|
directory on disk and the file doesn't exist. */
|
||||||
|
else if (pc.error == EROFS && (flags & O_ACCMODE) == O_RDONLY)
|
||||||
|
set_errno (ENOENT);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -889,8 +889,11 @@ is_virtual_symlink:
|
|||||||
subsequent code handles the file correctly.
|
subsequent code handles the file correctly.
|
||||||
Unless /dev itself doesn't exist on disk. In that case /dev
|
Unless /dev itself doesn't exist on disk. In that case /dev
|
||||||
is handled as virtual filesystem, and virtual filesystems are
|
is handled as virtual filesystem, and virtual filesystems are
|
||||||
read-only. */
|
read-only. The PC_KEEP_HANDLE check allows to check for
|
||||||
if (sym.error == ENOENT)
|
a call from an informational system call. In that case we
|
||||||
|
just stick to ENOENT, and the device type doesn't matter
|
||||||
|
anyway. */
|
||||||
|
if (sym.error == ENOENT && !(opt & PC_KEEP_HANDLE))
|
||||||
sym.error = EROFS;
|
sym.error = EROFS;
|
||||||
else
|
else
|
||||||
dev.d.devn = FH_FS;
|
dev.d.devn = FH_FS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user