aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/rlimit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/firejail/rlimit.c')
-rw-r--r--src/firejail/rlimit.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/firejail/rlimit.c b/src/firejail/rlimit.c
index a774fd6f5..47dd846d2 100644
--- a/src/firejail/rlimit.c
+++ b/src/firejail/rlimit.c
@@ -27,6 +27,9 @@ void set_rlimits(void) {
27 if (arg_rlimit_nofile) { 27 if (arg_rlimit_nofile) {
28 rl.rlim_cur = (rlim_t) cfg.rlimit_nofile; 28 rl.rlim_cur = (rlim_t) cfg.rlimit_nofile;
29 rl.rlim_max = (rlim_t) cfg.rlimit_nofile; 29 rl.rlim_max = (rlim_t) cfg.rlimit_nofile;
30#ifdef HAVE_GCOV // gcov-instrumented programs might crash at this point
31 __gcov_dump();
32#endif
30 if (setrlimit(RLIMIT_NOFILE, &rl) == -1) 33 if (setrlimit(RLIMIT_NOFILE, &rl) == -1)
31 errExit("setrlimit"); 34 errExit("setrlimit");
32 if (arg_debug) 35 if (arg_debug)
@@ -36,6 +39,9 @@ void set_rlimits(void) {
36 if (arg_rlimit_nproc) { 39 if (arg_rlimit_nproc) {
37 rl.rlim_cur = (rlim_t) cfg.rlimit_nproc; 40 rl.rlim_cur = (rlim_t) cfg.rlimit_nproc;
38 rl.rlim_max = (rlim_t) cfg.rlimit_nproc; 41 rl.rlim_max = (rlim_t) cfg.rlimit_nproc;
42#ifdef HAVE_GCOV
43 __gcov_dump();
44#endif
39 if (setrlimit(RLIMIT_NPROC, &rl) == -1) 45 if (setrlimit(RLIMIT_NPROC, &rl) == -1)
40 errExit("setrlimit"); 46 errExit("setrlimit");
41 if (arg_debug) 47 if (arg_debug)
@@ -45,6 +51,9 @@ void set_rlimits(void) {
45 if (arg_rlimit_fsize) { 51 if (arg_rlimit_fsize) {
46 rl.rlim_cur = (rlim_t) cfg.rlimit_fsize; 52 rl.rlim_cur = (rlim_t) cfg.rlimit_fsize;
47 rl.rlim_max = (rlim_t) cfg.rlimit_fsize; 53 rl.rlim_max = (rlim_t) cfg.rlimit_fsize;
54#ifdef HAVE_GCOV
55 __gcov_dump();
56#endif
48 if (setrlimit(RLIMIT_FSIZE, &rl) == -1) 57 if (setrlimit(RLIMIT_FSIZE, &rl) == -1)
49 errExit("setrlimit"); 58 errExit("setrlimit");
50 if (arg_debug) 59 if (arg_debug)
@@ -54,6 +63,9 @@ void set_rlimits(void) {
54 if (arg_rlimit_sigpending) { 63 if (arg_rlimit_sigpending) {
55 rl.rlim_cur = (rlim_t) cfg.rlimit_sigpending; 64 rl.rlim_cur = (rlim_t) cfg.rlimit_sigpending;
56 rl.rlim_max = (rlim_t) cfg.rlimit_sigpending; 65 rl.rlim_max = (rlim_t) cfg.rlimit_sigpending;
66#ifdef HAVE_GCOV
67 __gcov_dump();
68#endif
57 if (setrlimit(RLIMIT_SIGPENDING, &rl) == -1) 69 if (setrlimit(RLIMIT_SIGPENDING, &rl) == -1)
58 errExit("setrlimit"); 70 errExit("setrlimit");
59 if (arg_debug) 71 if (arg_debug)