Relocate ifdef LIBDBUSPOLICY to avoid build erros when libdbuspolicy is disabled 45/84045/1
authorHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 16 Aug 2016 09:13:28 +0000 (18:13 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Tue, 16 Aug 2016 09:13:28 +0000 (18:13 +0900)
Change-Id: I8710e8d2ff1911ea11b48984ebda227a0a8658fe
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
dbus/dbus-transport-kdbus.c

index 126e932..2fa932e 100644 (file)
@@ -646,13 +646,13 @@ debug_str (const char *msg, const DBusString *str)
 }
 #endif
 
+#ifdef LIBDBUSPOLICY
 static int
 can_send (DBusTransportKdbus *transport,
           DBusMessage        *message)
 {
-  int ret = DBUSPOLICY_RESULT_ALLOW;
 
-#ifdef LIBDBUSPOLICY
+    int ret = DBUSPOLICY_RESULT_ALLOW;
     if (NULL != transport->policy)
       {
         dbus_uint32_t reply_serial = dbus_message_get_reply_serial (message);
@@ -672,10 +672,10 @@ can_send (DBusTransportKdbus *transport,
                                        reply_serial,
                                        !dbus_message_get_no_reply (message));
       }
-#endif
 
   return ret;
 }
+#endif
 
 /* function prototypes */
 static int kdbus_message_size (const struct kdbus_msg *msg,
@@ -897,6 +897,7 @@ kdbus_write_msg_internal (DBusTransportKdbus  *transport,
       setup_bloom_filter_for_message (message, transport->kdbus, filter);
     }
 
+#ifdef LIBDBUSPOLICY
   if (check_privileges)
     {
       int check;
@@ -960,6 +961,7 @@ kdbus_write_msg_internal (DBusTransportKdbus  *transport,
           goto out;
         } /* ret != DBUSPOLICY_RESULT_ALLOW */
     } /* check_privileges */
+#endif
 
   if (send_message (transport,
                     msg,