chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unit,job: when we suppress a D-Bus signal because nobody is listening, don't delay...
[elogind.git]
/
execute.c
diff --git
a/execute.c
b/execute.c
index fe3dc8b251c502c33b6f2eacbfdcc880b6bbec1b..12f514504cabac8261fa3b39e863bf9841615718 100644
(file)
--- a/
execute.c
+++ b/
execute.c
@@
-35,6
+35,7
@@
#include <grp.h>
#include <pwd.h>
#include <sys/mount.h>
#include <grp.h>
#include <pwd.h>
#include <sys/mount.h>
+#include <linux/fs.h>
#include "execute.h"
#include "strv.h"
#include "execute.h"
#include "strv.h"
@@
-186,10
+187,12
@@
static int connect_logger_as(const ExecContext *context, ExecOutput output, cons
dprintf(fd,
"%s\n"
"%i\n"
dprintf(fd,
"%s\n"
"%i\n"
- "%s\n",
+ "%s\n"
+ "%i\n",
output == EXEC_OUTPUT_KERNEL ? "kmsg" : "syslog",
context->syslog_priority,
output == EXEC_OUTPUT_KERNEL ? "kmsg" : "syslog",
context->syslog_priority,
- context->syslog_identifier ? context->syslog_identifier : ident);
+ context->syslog_identifier ? context->syslog_identifier : ident,
+ !context->syslog_no_prefix);
if (fd != nfd) {
r = dup2(fd, nfd) < 0 ? -errno : nfd;
if (fd != nfd) {
r = dup2(fd, nfd) < 0 ? -errno : nfd;
@@
-391,8
+394,8
@@
static int chown_terminal(int fd, uid_t uid) {
assert(fd >= 0);
/* This might fail. What matters are the results. */
assert(fd >= 0);
/* This might fail. What matters are the results. */
- fchown(fd, uid, -1);
- fchmod(fd, TTY_MODE);
+
(void)
fchown(fd, uid, -1);
+
(void)
fchmod(fd, TTY_MODE);
if (fstat(fd, &st) < 0)
return -errno;
if (fstat(fd, &st) < 0)
return -errno;
@@
-467,7
+470,7
@@
fail:
return r;
}
return r;
}
-static int restore_conf
o
rm_stdio(const ExecContext *context,
+static int restore_conf
i
rm_stdio(const ExecContext *context,
int *saved_stdin,
int *saved_stdout,
bool *keep_stdin,
int *saved_stdin,
int *saved_stdout,
bool *keep_stdin,
@@
-723,6
+726,7
@@
int exec_spawn(ExecCommand *command,
char **argv,
const ExecContext *context,
int fds[], unsigned n_fds,
char **argv,
const ExecContext *context,
int fds[], unsigned n_fds,
+ char **environment,
bool apply_permissions,
bool apply_chroot,
bool confirm_spawn,
bool apply_permissions,
bool apply_chroot,
bool confirm_spawn,
@@
-822,7
+826,7
@@
int exec_spawn(ExecCommand *command,
}
/* Release terminal for the question */
}
/* Release terminal for the question */
- if ((r = restore_conf
o
rm_stdio(context,
+ if ((r = restore_conf
i
rm_stdio(context,
&saved_stdin, &saved_stdout,
&keep_stdin, &keep_stdout)))
goto fail;
&saved_stdin, &saved_stdout,
&keep_stdin, &keep_stdout)))
goto fail;
@@
-1033,7
+1037,9
@@
int exec_spawn(ExecCommand *command,
goto fail;
}
goto fail;
}
- if (!(final_env = strv_env_merge(environ, our_env, context->environment, NULL))) {
+ assert(n_env <= 6);
+
+ if (!(final_env = strv_env_merge(environment, our_env, context->environment, NULL))) {
r = EXIT_MEMORY;
goto fail;
}
r = EXIT_MEMORY;
goto fail;
}
@@
-1060,10
+1066,7
@@
int exec_spawn(ExecCommand *command,
* sure that when we kill the cgroup the process will be
* killed too). */
if (cgroup_bondings)
* sure that when we kill the cgroup the process will be
* killed too). */
if (cgroup_bondings)
- if ((r = cgroup_bonding_install_list(cgroup_bondings, pid)) < 0) {
- r = EXIT_CGROUP;
- goto fail;
- }
+ cgroup_bonding_install_list(cgroup_bondings, pid);
log_debug("Forked %s as %llu", command->path, (unsigned long long) pid);
log_debug("Forked %s as %llu", command->path, (unsigned long long) pid);