projects
/
dss.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix --config-file for relative paths.
[dss.git]
/
exec.c
diff --git
a/exec.c
b/exec.c
index 36602df7588a49fa0dc92157bc95dd33c1dd9c00..ece7ec29aa233051cf10bd5c4f3b1b6adfd14cfe 100644
(file)
--- a/
exec.c
+++ b/
exec.c
@@
-1,8
+1,4
@@
-/*
- * Copyright (C) 2003-2011 Andre Noll <maan@systemlinux.org>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* SPDX-License-Identifier: GPL-2.0 */
/** \file exec.c Helper functions for spawning new processes. */
/** \file exec.c Helper functions for spawning new processes. */
@@
-17,6
+13,7
@@
#include "log.h"
#include "err.h"
#include "str.h"
#include "log.h"
#include "err.h"
#include "str.h"
+#include "exec.h"
/**
* Spawn a new process using execvp().
/**
* Spawn a new process using execvp().
@@
-32,7
+29,7
@@
void dss_exec(pid_t *pid, const char *file, char *const *const args)
{
if ((*pid = fork()) < 0) {
void dss_exec(pid_t *pid, const char *file, char *const *const args)
{
if ((*pid = fork()) < 0) {
- DSS_EMERG_LOG(
"fork error: %s\n", strerror(errno
));
+ DSS_EMERG_LOG(
("fork error: %s\n", strerror(errno)
));
exit(EXIT_FAILURE);
}
if (*pid) /* parent */
exit(EXIT_FAILURE);
}
if (*pid) /* parent */
@@
-41,7
+38,7
@@
void dss_exec(pid_t *pid, const char *file, char *const *const args)
signal(SIGTERM, SIG_DFL);
signal(SIGCHLD, SIG_DFL);
execvp(file, args);
signal(SIGTERM, SIG_DFL);
signal(SIGCHLD, SIG_DFL);
execvp(file, args);
- DSS_EMERG_LOG(
"execvp error: %s\n", strerror(errno
));
+ DSS_EMERG_LOG(
("execvp error: %s\n", strerror(errno)
));
_exit(EXIT_FAILURE);
}
_exit(EXIT_FAILURE);
}
@@
-49,7
+46,7
@@
void dss_exec(pid_t *pid, const char *file, char *const *const args)
* Exec the command given as a command line.
*
* \param pid Will hold the pid of the created process upon return.
* Exec the command given as a command line.
*
* \param pid Will hold the pid of the created process upon return.
- * \param cmdline Holds the command and its arguments, sep
e
rated by spaces.
+ * \param cmdline Holds the command and its arguments, sep
a
rated by spaces.
*
* This function uses fork/exec to create a new process.
*
*
* This function uses fork/exec to create a new process.
*
@@
-59,7
+56,7
@@
void dss_exec_cmdline_pid(pid_t *pid, const char *cmdline)
{
char **argv, *tmp = dss_strdup(cmdline);
{
char **argv, *tmp = dss_strdup(cmdline);
- split_args(tmp, &argv
, " \t"
);
+ split_args(tmp, &argv);
dss_exec(pid, argv[0], argv);
free(argv);
free(tmp);
dss_exec(pid, argv[0], argv);
free(argv);
free(tmp);