1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
  
     | 
    
      From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Thu, 30 Jun 2022 14:06:32 +1000
Subject: portal: fix the strcmps on the cgroup hierarchies
Fixes
../libportal/portal.c:344:12: warning: logical not is only applied
to the left hand side of this comparison [-Wlogical-not-parentheses]
           !strcmp (controller, ":") != 0) &&
Origin: upstream, 0.7, commit:4a0f893a96eba958f91032ce33f9aca543052f00
---
 libportal/portal.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libportal/portal.c b/libportal/portal.c
index 5e72089..32a34d7 100644
--- a/libportal/portal.c
+++ b/libportal/portal.c
@@ -304,9 +304,10 @@ _xdp_parse_cgroup_file (FILE *f, gboolean *is_snap)
 
       /* Only consider the freezer, systemd group or unified cgroup
        * hierarchies */
-      if ((!strcmp (controller, "freezer:") != 0 ||
-           !strcmp (controller, "name=systemd:") != 0 ||
-           !strcmp (controller, ":") != 0) &&
+      if (controller != NULL &&
+          (g_str_equal (controller, "freezer:") ||
+           g_str_equal (controller, "name=systemd:") ||
+           g_str_equal (controller, ":")) &&
           strstr (cgroup, "/snap.") != NULL)
         {
           *is_snap = TRUE;
 
     |