summaryrefslogtreecommitdiff
path: root/subproc.c
diff options
context:
space:
mode:
authorRobert Swiecki <robert@swiecki.net>2018-11-06 17:52:03 +0100
committerRobert Swiecki <robert@swiecki.net>2018-11-06 17:52:03 +0100
commit5a05828a98a04d396f07f5f79c939da08ff2a7e5 (patch)
treef76571e6dc9d86b8f8da1fa79db76c31e6fe9baa /subproc.c
parent6eb82f66a13f13de6075d8c6309245c756e7f8fc (diff)
downloadhonggfuzz-5a05828a98a04d396f07f5f79c939da08ff2a7e5.tar.gz
cmdline: implement RLIMIT_CORE setting - proper setting
Diffstat (limited to 'subproc.c')
-rw-r--r--subproc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/subproc.c b/subproc.c
index ae3ce27c..39935731 100644
--- a/subproc.c
+++ b/subproc.c
@@ -187,14 +187,12 @@ static bool subproc_PrepareExecv(run_t* run) {
}
#endif /* ifdef RLIMIT_DATA */
#ifdef RLIMIT_CORE
- if (run->global->exe.dataLimit) {
- const struct rlimit rl = {
- .rlim_cur = run->global->exe.coreLimit * 1024ULL * 1024ULL,
- .rlim_max = run->global->exe.coreLimit * 1024ULL * 1024ULL,
- };
- if (setrlimit(RLIMIT_CORE, &rl) == -1) {
- PLOG_W("Couldn't enforce the RLIMIT_CORE resource limit, ignoring");
- }
+ const struct rlimit rl = {
+ .rlim_cur = run->global->exe.coreLimit * 1024ULL * 1024ULL,
+ .rlim_max = run->global->exe.coreLimit * 1024ULL * 1024ULL,
+ };
+ if (setrlimit(RLIMIT_CORE, &rl) == -1) {
+ PLOG_W("Couldn't enforce the RLIMIT_CORE resource limit, ignoring");
}
#endif /* ifdef RLIMIT_CORE */