diff options
author | Aneesh Kumar K.V | 2011-10-25 08:40:39 +0200 |
---|---|---|
committer | Aneesh Kumar K.V | 2011-10-31 08:04:15 +0100 |
commit | 17b1971f631af18e87249ee6a509fcb47dec220d (patch) | |
tree | 09c23087b680624ce44ca41ef6580030c0fa8b00 /hw/9pfs | |
parent | MAINTAINERS: update wiki URL and machine names for target-xtensa (diff) | |
download | qemu-17b1971f631af18e87249ee6a509fcb47dec220d.tar.gz qemu-17b1971f631af18e87249ee6a509fcb47dec220d.tar.xz qemu-17b1971f631af18e87249ee6a509fcb47dec220d.zip |
hw/9pfs: Fix error handling in local_mknod
Update local_chown to remove unnecessary if loop
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs')
-rw-r--r-- | hw/9pfs/virtio-9p-local.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c index d561de88f0..b611681c0f 100644 --- a/hw/9pfs/virtio-9p-local.c +++ b/hw/9pfs/virtio-9p-local.c @@ -281,7 +281,7 @@ static int local_mknod(FsContext *fs_ctx, V9fsPath *dir_path, if (err == -1) { goto out; } - local_set_xattr(rpath(fs_ctx, path, buffer), credp); + err = local_set_xattr(rpath(fs_ctx, path, buffer), credp); if (err == -1) { serrno = errno; goto err_end; @@ -551,15 +551,12 @@ static int local_chown(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp) char *path = fs_path->data; if ((credp->fc_uid == -1 && credp->fc_gid == -1) || - (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH)) { - return lchown(rpath(fs_ctx, path, buffer), credp->fc_uid, - credp->fc_gid); + (fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) || + (fs_ctx->export_flags & V9FS_SM_NONE)) { + return lchown(rpath(fs_ctx, path, buffer), + credp->fc_uid, credp->fc_gid); } else if (fs_ctx->export_flags & V9FS_SM_MAPPED) { return local_set_xattr(rpath(fs_ctx, path, buffer), credp); - } else if ((fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) || - (fs_ctx->export_flags & V9FS_SM_NONE)) { - return lchown(rpath(fs_ctx, path, buffer), credp->fc_uid, - credp->fc_gid); } return -1; } |