* [Qemu-devel] [5482] open() can also return EPERM for O_RDWR on a readonly device
@ 2008-10-13 21:08 Aurelien Jarno
0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2008-10-13 21:08 UTC (permalink / raw)
To: qemu-devel
Revision: 5482
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5482
Author: aurel32
Date: 2008-10-13 21:08:34 +0000 (Mon, 13 Oct 2008)
Log Message:
-----------
open() can also return EPERM for O_RDWR on a readonly device
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Modified Paths:
--------------
trunk/block.c
Modified: trunk/block.c
===================================================================
--- trunk/block.c 2008-10-13 21:08:25 UTC (rev 5481)
+++ trunk/block.c 2008-10-13 21:08:34 UTC (rev 5482)
@@ -399,7 +399,7 @@
else
open_flags = flags & ~(BDRV_O_FILE | BDRV_O_SNAPSHOT);
ret = drv->bdrv_open(bs, filename, open_flags);
- if (ret == -EACCES && !(flags & BDRV_O_FILE)) {
+ if ((ret == -EACCES || ret == -EPERM) && !(flags & BDRV_O_FILE)) {
ret = drv->bdrv_open(bs, filename, BDRV_O_RDONLY);
bs->read_only = 1;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-10-13 21:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-13 21:08 [Qemu-devel] [5482] open() can also return EPERM for O_RDWR on a readonly device Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).