diff options
author | Aleksey Manevich <manevich.aleksey@gmail.com> | 2016-07-27 21:44:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-27 21:44:32 +0300 |
commit | 9750045412d652076310772266b143b1b289f00e (patch) | |
tree | b1d7c90dde5575c03aa20c9272ece69c21104d3f | |
parent | fixed faudit compile problem for non-intel platforms (diff) | |
download | firejail-9750045412d652076310772266b143b1b289f00e.tar.gz firejail-9750045412d652076310772266b143b1b289f00e.tar.zst firejail-9750045412d652076310772266b143b1b289f00e.zip |
Honor --nice option when joining
-rw-r--r-- | src/firejail/join.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/firejail/join.c b/src/firejail/join.c index 47d31669d..504748331 100644 --- a/src/firejail/join.c +++ b/src/firejail/join.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <fcntl.h> | 23 | #include <fcntl.h> |
24 | #include <unistd.h> | 24 | #include <unistd.h> |
25 | #include <sys/prctl.h> | 25 | #include <sys/prctl.h> |
26 | #include <errno.h> | ||
26 | 27 | ||
27 | static int apply_caps = 0; | 28 | static int apply_caps = 0; |
28 | static uint64_t caps = 0; | 29 | static uint64_t caps = 0; |
@@ -338,6 +339,17 @@ void join(pid_t pid, int argc, char **argv, int index) { | |||
338 | if (setenv("PROMPT_COMMAND", "export PS1=\"\\[\\e[1;32m\\][\\u@\\h \\W]\\$\\[\\e[0m\\] \"", 1) < 0) | 339 | if (setenv("PROMPT_COMMAND", "export PS1=\"\\[\\e[1;32m\\][\\u@\\h \\W]\\$\\[\\e[0m\\] \"", 1) < 0) |
339 | errExit("setenv"); | 340 | errExit("setenv"); |
340 | 341 | ||
342 | // set nice | ||
343 | if (arg_nice) { | ||
344 | errno = 0; | ||
345 | int rv = nice(cfg.nice); | ||
346 | (void) rv; | ||
347 | if (errno) { | ||
348 | fprintf(stderr, "Warning: cannot set nice value\n"); | ||
349 | errno = 0; | ||
350 | } | ||
351 | } | ||
352 | |||
341 | // run cmdline trough /bin/bash | 353 | // run cmdline trough /bin/bash |
342 | if (cfg.command_line == NULL) { | 354 | if (cfg.command_line == NULL) { |
343 | struct stat s; | 355 | struct stat s; |