diff --git a/src/launcherlib/CMakeLists.txt b/src/launcherlib/CMakeLists.txt index 047494b..b199674 100644 --- a/src/launcherlib/CMakeLists.txt +++ b/src/launcherlib/CMakeLists.txt @@ -24,7 +24,7 @@ set(HEADERS appdata.h booster.h connection.h daemon.h logger.h launcherlib.h # Set libraries to be linked. Shared libraries to be preloaded are not linked in anymore, # but dlopen():ed and listed in src/launcher/preload.h instead. -link_libraries(${GLIB_LDFLAGS} ${DBUS_LDFLAGS} ${LIBDL} "-L/lib -lsystemd -lcap") +link_libraries(${GLIB_LDFLAGS} ${DBUS_LDFLAGS} ${LIBDL} "-L/lib -lcap") # Set executable add_library(applauncherd SHARED ${SRC} ${MOC_SRC}) diff --git a/src/launcherlib/daemon.cpp b/src/launcherlib/daemon.cpp index b70b377..8a78409 100644 --- a/src/launcherlib/daemon.cpp +++ b/src/launcherlib/daemon.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -979,7 +980,8 @@ void Daemon::parseArgs(int argc, char **argv) // Prints the usage and exits with given status void Daemon::usage(const char *name, int status) { - name = basename(name); + char *nameCopy = strdup(name); + name = basename(nameCopy); printf("\n" "Start the application launcher daemon.\n" "\n" @@ -1008,6 +1010,8 @@ void Daemon::usage(const char *name, int status) "\n", name, name, name); + free(nameCopy); + exit(status); }