summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanghyeok.oh <sanghyeok.oh@samsung.com>2019-01-29 07:53:20 (GMT)
committerHyotaek Shim <hyotaek.shim@samsung.com>2019-02-08 02:06:55 (GMT)
commit8e5459d1c8b96daffc26bde742be03fa19a20d02 (patch)
treed97210643df2b700f279abe5f8c713b875ca6cf3
parent2c328fac949e3e99fed4e9396d5f65d7b1ee5916 (diff)
downloadlibdevice-node-8e5459d1c8b96daffc26bde742be03fa19a20d02.zip
libdevice-node-8e5459d1c8b96daffc26bde742be03fa19a20d02.tar.gz
libdevice-node-8e5459d1c8b96daffc26bde742be03fa19a20d02.tar.bz2
dbus: remove systemd start/stop unit apirefs/changes/65/198765/3
Change-Id: Ic498a2c56ffaccdcacf2c01d5d20a169fc5324cf Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
-rw-r--r--CMakeLists.txt4
-rwxr-xr-x[-rw-r--r--]hw/usb_cfs_client_common.c10
-rwxr-xr-x[-rw-r--r--]hw/usb_client_common.c9
-rw-r--r--packaging/libdevice-node.spec17
4 files changed, 21 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fcf2780..eaabdc1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/${INC_DIR})
INCLUDE(FindPkgConfig)
-pkg_check_modules(rpkgs REQUIRED dlog vconf glib-2.0 libsystemd libusbgx)
+pkg_check_modules(rpkgs REQUIRED dlog vconf glib-2.0 libsystemd libusbgx libgdbus)
FOREACH(flag ${rpkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -40,7 +40,7 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${rpkgs_LDFLAGS} "-ldl")
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
-ADD_LIBRARY(hwcommon SHARED hw/common.c hw/systemd.c hw/usb_client_common.c hw/usb_cfs_client_common.c hw/usb_gadget_common.c)
+ADD_LIBRARY(hwcommon SHARED hw/common.c hw/usb_client_common.c hw/usb_cfs_client_common.c hw/usb_gadget_common.c)
TARGET_LINK_LIBRARIES(hwcommon ${rpkgs_LDFLAGS} "-ldl")
SET_TARGET_PROPERTIES(hwcommon PROPERTIES SOVERSION ${VERSION})
INSTALL(TARGETS hwcommon DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
diff --git a/hw/usb_cfs_client_common.c b/hw/usb_cfs_client_common.c
index 1982283..3a4246b 100644..100755
--- a/hw/usb_cfs_client_common.c
+++ b/hw/usb_cfs_client_common.c
@@ -17,7 +17,6 @@
*/
#include <hw/usb_client.h>
-#include <hw/systemd.h>
#include <hw/shared.h>
#include <limits.h>
@@ -29,7 +28,8 @@
#include <usbg/usbg.h>
#include <unistd.h>
-#include <unistd.h>
+#include <libgdbus/dbus-systemd.h>
+
#define zalloc(amount) calloc(1, amount)
@@ -650,7 +650,7 @@ static int cfs_prep_ffs_service(const char *name, const char *instance,
if (ret < 0)
return ret;
- ret = systemd_start_socket(socket_name);
+ ret = systemd_start_unit_sync(socket_name, ".socket", -1);
if (ret < 0)
goto umount_ffs;
@@ -925,8 +925,8 @@ int hw_cfs_gadget_close(struct hw_common *common)
fws = container_of(usb_func,
struct usb_function_with_service,
func);
- systemd_stop_socket(fws->service);
- systemd_stop_service(fws->service);
+ systemd_stop_unit_sync(fws->service, ".socket", -1);
+ systemd_stop_unit_sync(fws->service, ".service", -1);
}
}
diff --git a/hw/usb_client_common.c b/hw/usb_client_common.c
index 50008ef..cf49131 100644..100755
--- a/hw/usb_client_common.c
+++ b/hw/usb_client_common.c
@@ -17,7 +17,6 @@
*/
#include <hw/usb_client.h>
-#include <hw/systemd.h>
#include <hw/shared.h>
#include <limits.h>
@@ -25,6 +24,8 @@
#include <string.h>
#include <unistd.h>
+#include <libgdbus/dbus-systemd.h>
+
#define zalloc(amount) calloc(1, amount)
#define MAX_GADGET_STR_LEN 256
@@ -560,7 +561,7 @@ static int legacy_enable(struct usb_client *usb)
fws = container_of(gadget->funcs[i],
struct usb_function_with_service, func);
- ret = systemd_start_service(fws->service);
+ ret = systemd_start_unit_sync(fws->service, ".service", -1);
if (ret < 0)
goto stop_services;
}
@@ -575,7 +576,7 @@ stop_services:
fws = container_of(gadget->funcs[i],
struct usb_function_with_service, func);
- systemd_stop_service(fws->service);
+ systemd_stop_unit_sync(fws->service, ".service", -1);
}
legacy_free_gadget(gadget);
@@ -600,7 +601,7 @@ static int legacy_disable(struct usb_client *usb)
continue;
fws = container_of(gadget->funcs[i], struct usb_function_with_service, func);
- ret = systemd_stop_service(fws->service);
+ ret = systemd_stop_unit_sync(fws->service, ".service", -1);
if (ret < 0)
goto free_gadget;
}
diff --git a/packaging/libdevice-node.spec b/packaging/libdevice-node.spec
index b2f46df..cef9b95 100644
--- a/packaging/libdevice-node.spec
+++ b/packaging/libdevice-node.spec
@@ -11,24 +11,25 @@ BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gio-2.0)
-BuildRequires: pkgconfig(gmock)
-BuildRequires: pkgconfig(capi-system-info)
-BuildRequires: pkgconfig(libsystemd)
-BuildRequires: pkgconfig(libusbgx)
+BuildRequires: pkgconfig(gmock)
+BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(libsystemd)
+BuildRequires: pkgconfig(libusbgx)
+BuildRequires: pkgconfig(libgdbus)
%description
development package of library to control OAL APIs
%package devel
-Summary: Control OAL APIs (devel)
-Requires: %{name} = %{version}-%{release}
+Summary: Control OAL APIs (devel)
+Requires: %{name} = %{version}-%{release}
%description devel
Library to control OAL APIs (devel)
%package -n device-haltests
-Summary: Device HAL(Hardware Abstraction Layer) Test Cases
-Requires: %{name} = %{version}-%{release}
+Summary: Device HAL(Hardware Abstraction Layer) Test Cases
+Requires: %{name} = %{version}-%{release}
%description -n device-haltests
Device HAL(Hardware Abstraction Layer) Test Cases