dbus: remove systemd start/stop unit api 65/198765/3
authorsanghyeok.oh <sanghyeok.oh@samsung.com>
Tue, 29 Jan 2019 07:53:20 +0000 (16:53 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Fri, 8 Feb 2019 02:06:55 +0000 (02:06 +0000)
Change-Id: Ic498a2c56ffaccdcacf2c01d5d20a169fc5324cf
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
CMakeLists.txt
hw/usb_cfs_client_common.c [changed mode: 0644->0755]
hw/usb_client_common.c [changed mode: 0644->0755]
packaging/libdevice-node.spec

index fcf2780..eaabdc1 100644 (file)
@@ -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)
old mode 100644 (file)
new mode 100755 (executable)
index 1982283..3a4246b
@@ -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);
                }
        }
 
old mode 100644 (file)
new mode 100755 (executable)
index 50008ef..cf49131
@@ -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;
        }
index b2f46df..cef9b95 100644 (file)
@@ -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