From: Peter Krempa <pkre...@redhat.com>

Fix linebreaks and remove the use of ternary operator.

Signed-off-by: Peter Krempa <pkre...@redhat.com>
---
 src/security/security_selinux.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 9d14e33340..fa5d1568eb 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -3526,23 +3526,24 @@ 
virSecuritySELinuxGetSecurityMountOptions(virSecurityManager *mgr,
 {
     char *opts = NULL;
     virSecurityLabelDef *secdef;
+    const char *imagelabel = NULL;

     if ((secdef = virDomainDefGetSecurityLabelDef(def, 
SECURITY_SELINUX_NAME))) {
         if (!secdef->imagelabel)
             secdef->imagelabel = virSecuritySELinuxGenImageLabel(mgr, def);

         if (secdef->imagelabel) {
-            opts = g_strdup_printf(
-                                   ",context=\"%s\"",
+            opts = g_strdup_printf(",context=\"%s\"",
                                    (const char*) secdef->imagelabel);
         }
+
+        imagelabel = secdef->imagelabel;
     }

     if (!opts)
         opts = g_strdup("");

-    VIR_DEBUG("imageLabel=%s opts=%s",
-              secdef ? secdef->imagelabel : "(null)", opts);
+    VIR_DEBUG("imageLabel=%s opts=%s", NULLSTR(imagelabel), opts);
     return opts;
 }

-- 
2.50.0

Reply via email to