summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanghyuk Ko <sanghyuk.ko@samsung.com>2013-03-29 21:47:30 +0900
committersanghyuk Ko <sanghyuk.ko@samsung.com>2013-03-29 21:47:30 +0900
commitc6ff9f983d221de56cc3cff085dc76e9ba623b55 (patch)
tree2fc825b7619b7e9d9773a2de8aba568302e46fc3
parent9c28ccac4ac51c29d57c160eea62dfa8f51be42a (diff)
downloadsync-agent-c6ff9f983d221de56cc3cff085dc76e9ba623b55.tar.gz
sync-agent-c6ff9f983d221de56cc3cff085dc76e9ba623b55.tar.bz2
sync-agent-c6ff9f983d221de56cc3cff085dc76e9ba623b55.zip
[Internal: changed] remove log, daemon check api added
[Problem] - [Cause] - [Solution] - When dbus-call failed, log removed - daemon check api add Change-Id: Ibbc623a3e63b59b0d9abbf3e80ed3caf31469606
-rwxr-xr-xsrc/framework/CMakeLists.txt1
-rwxr-xr-xsrc/framework/event/oma_ds_api.c33
2 files changed, 16 insertions, 18 deletions
diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt
index 9ef80df..f1c4e21 100755
--- a/src/framework/CMakeLists.txt
+++ b/src/framework/CMakeLists.txt
@@ -27,6 +27,7 @@ pkg_check_modules(LPKGS REQUIRED
libwbxml2
dlog
dbus-glib-1
+ sysman
)
#############################################
diff --git a/src/framework/event/oma_ds_api.c b/src/framework/event/oma_ds_api.c
index 2e94ba3..951f3b5 100755
--- a/src/framework/event/oma_ds_api.c
+++ b/src/framework/event/oma_ds_api.c
@@ -21,6 +21,7 @@
#include <glib.h>
#include <dbus/dbus-glib.h>
+#include <sysman_managed.h>
#ifndef SYNC_AGENT_LOG
#undef LOG_TAG
@@ -467,7 +468,6 @@ static int _launch_omads_agent(void)
DBusGConnection *connection = NULL;
DBusGProxy *dbus_proxy = NULL;
- gboolean bResult = FALSE;
g_type_init();
@@ -485,17 +485,7 @@ static int _launch_omads_agent(void)
_DEBUG_INFO("dbus_proxy %x", dbus_proxy);
//dbus_g_proxy_call_no_reply(dbus_proxy, "Hello_Agent", G_TYPE_INVALID);
- bResult = dbus_g_proxy_call(dbus_proxy, "Hello_Agent", &error, G_TYPE_INVALID, G_TYPE_INVALID);
-
- if (bResult == FALSE) {
- _DEBUG_ERROR("dbus_g_proxy_call failed: %s\n", error->message);
- g_error_free(error);
- g_object_unref(dbus_proxy);
- dbus_g_connection_unref(connection);
-
- _INNER_FUNC_EXIT;
- return -1;
- }
+ dbus_g_proxy_call(dbus_proxy, "Hello_Agent", &error, G_TYPE_INVALID, G_TYPE_INVALID);
g_object_unref(dbus_proxy);
dbus_g_connection_unref(connection);
@@ -551,15 +541,21 @@ EXPORT_API sync_agent_ds_error_e sync_agent_ds_init()
sync_agent_ds_error_e result = SYNC_AGENT_DS_SUCCESS;
sync_agent_init_error_e init_error = SYNC_AGENT_INIT_SUCCESS;
int ret = -1;
+ int pid = -1;
- ret = _launch_omads_agent();
+ _DEBUG_INFO("before sysman_get_pid");
+ pid = sysman_get_pid("/usr/bin/oma-ds-agent");
+ _DEBUG_INFO("oma-ds-agent pid [%d]", pid);
- if (ret < 0 ) {
- _DEBUG_ERROR("_launch_omads_agent() failed !!");
- result = SYNC_AGENT_DS_FAIL;
+ if(pid == -1 ) {
+ ret = _launch_omads_agent();
+ if (ret < 0 ) {
+ _DEBUG_ERROR("_launch_omads_agent() failed !!");
+ result = SYNC_AGENT_DS_FAIL;
- _EXTERN_FUNC_EXIT;
- return result;
+ _EXTERN_FUNC_EXIT;
+ return result;
+ }
}
init_error = sync_agent_init(OMA_DS_CONFIG_FILE);
@@ -1697,6 +1693,7 @@ EXPORT_API sync_agent_ds_error_e sync_agent_ds_deinit()
sync_agent_ds_error_e result = SYNC_AGENT_DS_SUCCESS;
sync_agent_deinit_error_e deinit = SYNC_AGENT_DEINIT_SUCCESS;
+
int ret = -1;
ret = _kill_omads_agent();