Fix build error with ENABLE_LIBDEVICED_DLOG option on Tizen 6.0 80/231080/1
authorINSUN PYO <insun.pyo@samsung.com>
Thu, 9 Apr 2020 00:19:43 +0000 (09:19 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 17 Apr 2020 06:36:25 +0000 (06:36 +0000)
If NULL is passed as the %s argument of dlog, gcc reports an error.

Change-Id: Id70287787362f152efbbf5935c76646500321188
(cherry picked from commit 7518a195e9d9f2f45a5f36b31350fed299b2fcab)

src/libgdbus/dbus-system.c
src/libgdbus/dbus-systemd.c

index 8038709b63f8d604f3b2d45b784fb0bc26c4e739..f57f147f3d740d1ea55ade9f40b12e64e3be37c6 100644 (file)
@@ -344,7 +344,7 @@ static void _dbus_handle_remove_bus_name(dbus_handle_s *handle, const char *bus_
        dbus_name *dn = NULL;
 
        if (!bus_name) {
-               _E("wrong bus_name %s", bus_name);
+               _E("wrong bus_name is null");
                return ;
        }
        if (!dh) {
@@ -2698,7 +2698,7 @@ int dbus_handle_watch_name(const char *name,
        guint id = 0;
 
        if (!name) {
-               _E("wrong name name %s", name);
+               _E("wrong name name is null");
                return -1;
        }
        if (!name_appeared_handler && !name_vanished_handler) {
@@ -2778,7 +2778,7 @@ char **dbus_handle_get_owner_list(dbus_handle_h handle, const char *bus_name)
        int i = 0;
 
        if (!bus_name) {
-               _E("wrong parameter bus_name(%s)", bus_name);
+               _E("wrong parameter bus_name is null");
                return NULL;
        }
 
index 54d38570ed3aded9b5a79e639917c52c89a7b54a..6da7748cfa4ba20ea894be37514ea8f5a2864709 100644 (file)
@@ -213,7 +213,8 @@ static int _change_suffix(const char *name,
        int ret = 0;
 
        if (!name || !suffix || !new_name) {
-               _E("Wrong param name:%s, suffix:%s, new_name:%s", name, suffix, new_name);
+               _E("Wrong param name:%s, suffix:%s, new_name:%s (null)",
+                       name ? : "(null)", suffix ? : "(null)", new_name ? "not" : "");
                return -EINVAL;
        }
 
@@ -298,7 +299,7 @@ static int _systemd_control_unit(const char *name,
        int ret = 0;
 
        if (!name || !method) {
-               _E("Wrong param name %s, method %s", name, method);
+               _E("Wrong param name %s, method %s", name ? : "(null)", method ? : "(null)");
                return -EINVAL;
        }
        if (timeout_msec < -1) {