From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Mon, 1 Oct 2018 15:57:36 +0000 (+0100) Subject: trap: Allow chdir /tmp even if prctl not supported. X-Git-Tag: v4.2.7~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19b94586321f8f0aac2c0f4b5e210a87db75199d;p=thirdparty%2Ftvheadend.git trap: Allow chdir /tmp even if prctl not supported. Even though prctl is Linux specific, other platforms allow core dumps to occur in the cwd, so it's useful to allow the "cd /tmp" for those platforms if the existing --dump option is specified. --- diff --git a/src/main.c b/src/main.c index c277c923a..a6770e236 100644 --- a/src/main.c +++ b/src/main.c @@ -1112,9 +1112,9 @@ main(int argc, char **argv) /* Make dumpable */ if (opt_dump) { -#ifdef PLATFORM_LINUX if (chdir("/tmp")) tvhwarn(LS_START, "failed to change cwd to /tmp"); +#ifdef PLATFORM_LINUX prctl(PR_SET_DUMPABLE, 1); #else tvhwarn(LS_START, "Coredumps not implemented on your platform");