chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
execute: also set SO_SNDBUF when spawning a service with stdout/stderr connected...
[elogind.git]
/
src
/
core
/
execute.c
diff --git
a/src/core/execute.c
b/src/core/execute.c
index a0d63a41f9a521b82b806537d4db1e19505da468..5abc69dec4e6de7fcf146ea64fe9772a98cf72fe 100644
(file)
--- a/
src/core/execute.c
+++ b/
src/core/execute.c
@@
-41,6
+41,7
@@
#include <linux/seccomp-bpf.h>
#include <glob.h>
#include <libgen.h>
#include <linux/seccomp-bpf.h>
#include <glob.h>
#include <libgen.h>
+#undef basename
#ifdef HAVE_PAM
#include <security/pam_appl.h>
#ifdef HAVE_PAM
#include <security/pam_appl.h>
@@
-74,6
+75,8
@@
/* This assumes there is a 'tty' group */
#define TTY_MODE 0620
/* This assumes there is a 'tty' group */
#define TTY_MODE 0620
+#define SNDBUF_SIZE (8*1024*1024)
+
static int shift_fds(int fds[], unsigned n_fds) {
int start, restart_from;
static int shift_fds(int fds[], unsigned n_fds) {
int start, restart_from;
@@
-220,6
+223,8
@@
static int connect_logger_as(const ExecContext *context, ExecOutput output, cons
return -errno;
}
return -errno;
}
+ fd_inc_sndbuf(fd, SNDBUF_SIZE);
+
dprintf(fd,
"%s\n"
"%s\n"
dprintf(fd,
"%s\n"
"%s\n"
@@
-908,7
+913,7
@@
static void rename_process_from_path(const char *path) {
/* This resulting string must fit in 10 chars (i.e. the length
* of "/sbin/init") to look pretty in /bin/ps */
/* This resulting string must fit in 10 chars (i.e. the length
* of "/sbin/init") to look pretty in /bin/ps */
- p =
path_get_file_
name(path);
+ p =
base
name(path);
if (isempty(p)) {
rename_process("(...)");
return;
if (isempty(p)) {
rename_process("(...)");
return;
@@
-1197,13
+1202,13
@@
int exec_spawn(ExecCommand *command,
goto fail_child;
}
goto fail_child;
}
- err = setup_output(context, STDOUT_FILENO, socket_fd,
path_get_file_
name(command->path), unit_id, apply_tty_stdin);
+ err = setup_output(context, STDOUT_FILENO, socket_fd,
base
name(command->path), unit_id, apply_tty_stdin);
if (err < 0) {
r = EXIT_STDOUT;
goto fail_child;
}
if (err < 0) {
r = EXIT_STDOUT;
goto fail_child;
}
- err = setup_output(context, STDERR_FILENO, socket_fd,
path_get_file_
name(command->path), unit_id, apply_tty_stdin);
+ err = setup_output(context, STDERR_FILENO, socket_fd,
base
name(command->path), unit_id, apply_tty_stdin);
if (err < 0) {
r = EXIT_STDERR;
goto fail_child;
if (err < 0) {
r = EXIT_STDERR;
goto fail_child;