Add dlog for debugging and fix build warnings 82/199282/3 accepted/tizen/unified/20190211.060148 submit/tizen/20190208.083757
authorlokilee73 <changjoo.lee@samsung.com>
Fri, 8 Feb 2019 06:57:05 +0000 (15:57 +0900)
committersanghyeok.oh <sanghyeok.oh@samsung.com>
Fri, 8 Feb 2019 07:44:48 +0000 (16:44 +0900)
Change-Id: Idad13056a15185a622f51283589af7bedf5734df
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
packaging/libsyscommon.spec
src/libgdbus/CMakeLists.txt
src/libgdbus/dbus-system.c
src/libgdbus/dbus-system.h
src/libgdbus/dbus-systemd.c

index fb7114f..57175d4 100644 (file)
@@ -12,6 +12,7 @@ Source1001:     %{name}.manifest
 BuildRequires:  pkgconfig(glib-2.0) >= 2.44
 BuildRequires:  pkgconfig(gio-2.0) >= 2.44
 BuildRequires:  pkgconfig(gio-unix-2.0)
+BuildRequires:  pkgconfig(dlog)
 BuildRequires:  cmake
 
 Requires:       /bin/cp
index 06f1bc2..9baa020 100644 (file)
@@ -21,6 +21,7 @@ INCLUDE(FindPkgConfig)
 pkg_check_modules(gdbus REQUIRED
        glib-2.0
        gio-2.0
+       dlog
        gio-unix-2.0)
 
 FOREACH(flag ${gdbus_CFLAGS})
index e59da08..7ed53ba 100644 (file)
@@ -1557,7 +1557,7 @@ sig_ctx *dbus_handle_new_signal_ctx(void)
        }
        ctx->timeout_src = NULL;
        ctx->param = NULL;
-       ctx->quit_reason = 0;
+       ctx->quit_reason = CTX_QUIT_UNKNOWN;
        ctx->user_data = NULL;
 
        return ctx;
@@ -1618,7 +1618,6 @@ static gboolean _cb_ctx_timeout(gpointer user_data)
 int dbus_handle_signal_ctx_add_timeout(sig_ctx *ctx, int timeout_msec)
 {
        GSource *src = NULL;
-       guint id = 0;
 
        if (!ctx)
                return -EINVAL;
index ef5ba75..6cdec69 100644 (file)
@@ -496,6 +496,7 @@ typedef struct {
 sig_ctx *dbus_handle_new_signal_ctx(void);
 void dbus_handle_free_signal_ctx(sig_ctx *ctx);
 guint subscribe_dbus_signal_ctx(dbus_handle_h handle, sig_ctx *ctx, const char *sender,        const char *path, const char *iface, const char *name, GDBusSignalCallback cb);
+int dbus_handle_signal_ctx_wait(sig_ctx *ctx);
 int dbus_handle_signal_ctx_add_timeout(sig_ctx *ctx, int timeout);
 
 GVariant *dbus_handle_make_simple_array(const char *sig, int *param);
index 998468d..b06e2fa 100644 (file)
@@ -51,8 +51,8 @@
 #define UNIT_NAME_MAX 256
 
 typedef struct {
-       char *job_id;
-       char *unit_name;
+       const char *job_id;
+       const char *unit_name;
 } unitinfo;
 
 static void _cb_JobRemoved(GDBusConnection *conn,
@@ -108,7 +108,6 @@ static int _systemd_control_unit_sync(const char *method, const char *name, int
        gchar *objpath = NULL;
        int ret = 0;
        sig_ctx *ctx = NULL;
-       gchar *unit_name = NULL;
        unitinfo uinfo;
        int quit_reason;
 
@@ -118,7 +117,7 @@ static int _systemd_control_unit_sync(const char *method, const char *name, int
 
        _I("Starting: %s %s", method, name);
 
-       /* synchronous siganl subscriptsion */
+       /* synchronous signal subscription */
        ret = subscribe_dbus_signal_ctx(NULL, ctx, SYSTEMD_DBUS_SERVICE, SYSTEMD_DBUS_PATH, SYSTEMD_DBUS_IFACE_MANAGER, "JobRemoved", _cb_JobRemoved);
        if (ret == 0) {
                ret = -1;
@@ -158,9 +157,6 @@ static int _systemd_control_unit_sync(const char *method, const char *name, int
        _I("Finished: %s %s", method, name);
 
 finish:
-       if (unit_name)
-               g_free(unit_name);
-
        if (reply)
                g_variant_unref(reply);
        g_free(objpath);
@@ -199,22 +195,6 @@ finish:
        return ret;
 }
 
-static int _has_suffix(const char *service_name, const char *suffix)
-{
-       int index = 0;
-
-       if (!service_name || !suffix)
-               return FALSE;
-
-       index = strlen(service_name) - strlen(suffix);
-       if (index <= 0)
-               return FALSE;
-
-       if (strcmp(service_name + index, suffix) == 0)
-               return TRUE;
-       return FALSE;
-}
-
 static int _change_suffix(const char *name, const char *suffix, char **new_name)
 {
        char *buf = NULL;
@@ -301,7 +281,6 @@ Returns: the exit status
 static int _systemd_start_unit_internal(const char *name, const char *suffix,
                int timeout_msec, const char *method, int sync)
 {
-       unsigned int len = 0;
        char *new_name = NULL;
        int ret = 0;