[libvirt PATCH 10/14] storage: createFileDir: remove useless 'err' variable

Martin Kletzander mkletzan at redhat.com
Thu Sep 24 08:36:55 UTC 2020


On Wed, Sep 23, 2020 at 08:14:59PM +0200, Ján Tomko wrote:
>Signed-off-by: Ján Tomko <jtomko at redhat.com>

Reviewed-by: Martin Kletzander <mkletzan at redhat.com>

>---
> src/storage/storage_util.c | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
>
>diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
>index 9171cb084f..93c24ab6bc 100644
>--- a/src/storage/storage_util.c
>+++ b/src/storage/storage_util.c
>@@ -1997,7 +1997,6 @@ createFileDir(virStoragePoolObjPtr pool,
>               unsigned int flags)
> {
>     virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
>-    int err;
>
>     virCheckFlags(0, -1);
>
>@@ -2015,14 +2014,14 @@ createFileDir(virStoragePoolObjPtr pool,
>     }
>
>
>-    if ((err = virDirCreate(vol->target.path,
>-                            (vol->target.perms->mode == (mode_t)-1 ?
>-                             VIR_STORAGE_DEFAULT_VOL_PERM_MODE :
>-                             vol->target.perms->mode),
>-                            vol->target.perms->uid,
>-                            vol->target.perms->gid,
>-                            (def->type == VIR_STORAGE_POOL_NETFS
>-                             ? VIR_DIR_CREATE_AS_UID : 0))) < 0) {
>+    if (virDirCreate(vol->target.path,
>+                     (vol->target.perms->mode == (mode_t)-1 ?
>+                      VIR_STORAGE_DEFAULT_VOL_PERM_MODE :
>+                      vol->target.perms->mode),
>+                     vol->target.perms->uid,
>+                     vol->target.perms->gid,
>+                     (def->type == VIR_STORAGE_POOL_NETFS
>+                      ? VIR_DIR_CREATE_AS_UID : 0)) < 0) {
>         return -1;
>     }
>
>-- 
>2.26.2
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200924/c5cec339/attachment-0001.sig>


More information about the libvir-list mailing list