aboutsummaryrefslogtreecommitdiffstats
path: root/lib/loopdev.c
diff options
context:
space:
mode:
authorAlex Xu <351006+Hello71@users.noreply.github.com>2021-11-24 20:34:10 +0000
committerGitHub <noreply@github.com>2021-11-24 20:34:10 +0000
commitf6385a6adeea6be255d68016977c5dd5eaab05da (patch)
treec409e89cb59b60f1fd8b56a6b8cce4f97c78f1d4 /lib/loopdev.c
parent4441e511635f3e4116b59a77da1e4ca68552c3cc (diff)
downloadutil-linux-f6385a6adeea6be255d68016977c5dd5eaab05da.tar.gz
loopdev: accept ENOSYS for LOOP_CONFIGURE
qemu returns this if it doesn't understand the ioctl. according to ioctl(2) it should actually return EINVAL, but considering that it's been doing this for at least 20 years already, I doubt there's much appetite for change, considering that it has a slightly better error message if propagated back to the user and changing it to EINVAL may break other programs.
Diffstat (limited to 'lib/loopdev.c')
-rw-r--r--lib/loopdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c
index 679c8d7bcd..b5da1516e3 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -1364,7 +1364,7 @@ int loopcxt_setup_device(struct loopdev_cxt *lc)
if (ioctl(dev_fd, LOOP_CONFIGURE, &lc->config) < 0) {
rc = -errno;
errsv = errno;
- if (errno != EINVAL && errno != ENOTTY) {
+ if (errno != EINVAL && errno != ENOTTY && errno != ENOSYS) {
DBG(SETUP, ul_debugobj(lc, "LOOP_CONFIGURE failed: %m"));
goto err;
}