diff --git a/libcomposefs/lcfs-mount.c b/libcomposefs/lcfs-mount.c index 5438b3e4..2a3427ae 100644 --- a/libcomposefs/lcfs-mount.c +++ b/libcomposefs/lcfs-mount.c @@ -416,11 +416,12 @@ static errint_t lcfs_mount_ovl(struct lcfs_mount_state_s *state, char *imagemoun */ res = syscall_fsconfig(fd_fs, FSCONFIG_SET_STRING, "lowerdir+", imagemount, 0); - /* EINVAL lack of support for appending as per above, fallback */ - if (errno == EINVAL) - return -ENOSYS; - if (res < 0) + if (res < 0) { + /* EINVAL lack of support for appending as per above, fallback */ + if (errno == EINVAL) + return -ENOSYS; return -errno; + } for (size_t i = 0; i < state->options->n_objdirs; i++) { const char *objdir = state->options->objdirs[i];