]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
apparmor: Fix build failure with --disable-apparmor
authorTyler Hicks <tyhicks@canonical.com>
Wed, 18 Feb 2015 21:44:59 +0000 (15:44 -0600)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Thu, 19 Feb 2015 10:22:17 +0000 (10:22 +0000)
The bus_apparmor_confinement_unref() function definition must exist even
when building with --disable-apparmor.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75113
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
bus/apparmor.c

index 072e2edf9e6e92f4e6613d66dc729c7a5cd82240..a1b3621a7d363cd1538796cad11d289d4a67e02d 100644 (file)
@@ -105,30 +105,6 @@ bus_apparmor_confinement_new (char       *label,
   return confinement;
 }
 
-void
-bus_apparmor_confinement_unref (BusAppArmorConfinement *confinement)
-{
-#ifdef HAVE_APPARMOR
-  if (!apparmor_enabled)
-    return;
-
-  _dbus_assert (confinement != NULL);
-  _dbus_assert (confinement->refcount > 0);
-
-  confinement->refcount -= 1;
-
-  if (confinement->refcount == 0)
-    {
-      /**
-       * Do not free confinement->mode, as libapparmor does a single malloc for
-       * both confinement->label and confinement->mode.
-       */
-      free (confinement->label);
-      dbus_free (confinement);
-    }
-#endif
-}
-
 void
 bus_apparmor_audit_init (void)
 {
@@ -552,6 +528,30 @@ bus_apparmor_enabled (void)
 #endif
 }
 
+void
+bus_apparmor_confinement_unref (BusAppArmorConfinement *confinement)
+{
+#ifdef HAVE_APPARMOR
+  if (!apparmor_enabled)
+    return;
+
+  _dbus_assert (confinement != NULL);
+  _dbus_assert (confinement->refcount > 0);
+
+  confinement->refcount -= 1;
+
+  if (confinement->refcount == 0)
+    {
+      /**
+       * Do not free confinement->mode, as libapparmor does a single malloc for
+       * both confinement->label and confinement->mode.
+       */
+      free (confinement->label);
+      dbus_free (confinement);
+    }
+#endif
+}
+
 void
 bus_apparmor_confinement_ref (BusAppArmorConfinement *confinement)
 {