diff options
author | Murray Calavera <murray.calavera@gmail.com> | 2016-04-21 17:46:03 +0000 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2016-04-24 11:51:28 -0400 |
commit | d7072e1631120532d9635ca87f8b1af34ddf36c7 (patch) | |
tree | 0661dbaf1b556fdbec76071ab83fe9f67212bb51 /src | |
parent | 7f4f5b7dba1122c2fdc75dc4b704bdc53ad030b9 (diff) |
shared: remove unused function `execute_command`
Signed-off-by: Murray Calavera <murray.calavera@gmail.com>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/util.c | 40 | ||||
-rw-r--r-- | src/shared/util.h | 2 |
2 files changed, 0 insertions, 42 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index 156f483826..ac69ae80e2 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -62,7 +62,6 @@ #include "strv.h" #include "mkdir.h" #include "path-util.h" -#include "exit-status.h" #include "hashmap.h" #include "fileio.h" #include "utf8.h" @@ -1960,45 +1959,6 @@ finish: return 1; } -int execute_command(const char *command, char *const argv[]) { - - pid_t pid; - int status; - - if ((status = access(command, X_OK)) != 0) - return status; - - if ((pid = fork()) < 0) { - log_error_errno(errno, "Failed to fork: %m"); - return pid; - } - - if (pid == 0) { - - execvp(command, argv); - - log_error_errno(errno, "Failed to execute %s: %m", command); - _exit(EXIT_FAILURE); - } - else while (1) - { - siginfo_t si; - - int r = waitid(P_PID, pid, &si, WEXITED); - - if (!is_clean_exit(si.si_code, si.si_status, NULL)) { - if (si.si_code == CLD_EXITED) - log_error("%s exited with exit status %i.", command, si.si_status); - else - log_error("%s terminated by signal %s.", command, signal_to_string(si.si_status)); - } else - log_debug("%s exited successfully.", command); - - return si.si_status; - - } -} - void cmsg_close_all(struct msghdr *mh) { struct cmsghdr *cmsg; diff --git a/src/shared/util.h b/src/shared/util.h index e9178b9bd3..5c1dc48019 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -420,8 +420,6 @@ typedef enum UnquoteFlags { int unquote_first_word(const char **p, char **ret, UnquoteFlags flags); -int execute_command(const char *command, char *const argv[]); - #define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1) #define FOREACH_INOTIFY_EVENT(e, buffer, sz) \ |