[Fix Web TCT fail] 65/200465/1 accepted/tizen/unified/20190307.230837 accepted/tizen/unified/20190311.072425 submit/tizen/20190225.110550 submit/tizen/20190308.015145
authorJihoon Jung <jh8801.jung@samsung.com>
Mon, 25 Feb 2019 10:48:00 +0000 (19:48 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Mon, 25 Feb 2019 10:50:04 +0000 (19:50 +0900)
- Remove unused code
- change service file path correctly

Change-Id: I5560ef65794c5bca66e543099954ed6589dd603c

packaging/smartcard-service.spec
server/CMakeLists.txt
server/smartcard-daemon.cpp

index ec62fb9..381ef6c 100755 (executable)
@@ -69,13 +69,14 @@ export LDFLAGS+=" -lgcov "
 
 mkdir -p %{buildroot}/etc/dbus-1/system.d/
 cp -af %{_builddir}/%{name}-%{version}/packaging/org.tizen.SmartcardService.conf %{buildroot}/etc/dbus-1/system.d/
+install -D -m 0644 server/org.tizen.SmartcardService.service %{buildroot}/%{_unitdir}/org.tizen.SmartcardService.service
 
 %files
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
 %{_bindir}/smartcard-daemon
 %{_sysconfdir}/dbus-1/system.d/org.tizen.SmartcardService.conf
-%{_datadir}/dbus-1/system-services/org.tizen.SmartcardService.service
+%{_unitdir}/org.tizen.SmartcardService.service
 %if 0%{?gtests:1}
 %{_bindir}/gtest*
 %endif
index 09cc9b7..bf970ab 100644 (file)
@@ -58,4 +58,3 @@ ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-L../common" "-lsmartcard-service-common" "-pie -ldl")
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.SmartcardService.service DESTINATION share/dbus-1/system-services)
index ed2adad..dba40ec 100644 (file)
@@ -46,49 +46,6 @@ GMainLoop *main_loop = NULL;
 extern "C" void __gcov_flush(void);
 #endif
 
-#ifndef USE_AUTOSTART
-static void daemonize(void)
-{
-       pid_t pid, sid;
-
-       /* already a daemon */
-       if (getppid() == 1)
-               return;
-
-       /* Fork off the parent process */
-       pid = fork();
-       if (pid < 0)
-       {
-               exit(EXIT_FAILURE);
-       }
-
-       if (pid > 0)
-       {
-               exit(EXIT_SUCCESS); /*Killing the Parent Process*/
-       }
-
-       /* At this point we are executing as the child process */
-       umask(0);
-
-       /* Create a new SID for the child process */
-       sid = setsid();
-       if (sid < 0)
-       {
-               exit(EXIT_FAILURE);
-       }
-
-       /* Change the current working directory. */
-       if ((chdir("/")) < 0)
-       {
-               exit(EXIT_FAILURE);
-       }
-
-       close(STDIN_FILENO);
-       close(STDOUT_FILENO);
-       close(STDERR_FILENO);
-}
-#endif
-
 static void _bus_acquired_cb(GDBusConnection *connection,
        const gchar *path, gpointer user_data)
 {
@@ -128,10 +85,6 @@ int main(int argc, char *argv[])
        guint id = 0;
        signal(SIGTERM, &__sighandler);
 
-#ifndef USE_AUTOSTART
-       daemonize();
-#endif
-
 #if (BUILD_GCOV != 0)
        setenv("GCOV_PREFIX", "/tmp/", 1);
 #endif