[libvirt PATCH 11/14] storage: createFileDir: use less ternary operators

Ján Tomko jtomko at redhat.com
Wed Sep 23 18:30:59 UTC 2020


On a Wednesday in 2020, Ján Tomko wrote:
>Introduce separate variables and if conditions
>with spaces around them to make the function call
>easier to read.
>
>Signed-off-by: Ján Tomko <jtomko at redhat.com>
>---
> src/storage/storage_util.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
>diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
>index 93c24ab6bc..49ecbc5344 100644
>--- a/src/storage/storage_util.c
>+++ b/src/storage/storage_util.c
>@@ -1997,6 +1997,8 @@ createFileDir(virStoragePoolObjPtr pool,
>               unsigned int flags)

This function already has flags ^

> {
>     virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
>+    mode_t permmode = VIR_STORAGE_DEFAULT_VOL_PERM_MODE;
>+    unsigned int flags = 0;

Consider
s/flags/createflags/
squashed in from here on

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200923/a8ea3602/attachment-0001.sig>


More information about the libvir-list mailing list