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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b540f4cad0da34e875dd54994c3f12d9ac25c9e7;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 24e53aceb..21abc93bb 100644 --- a/src/main.c +++ b/src/main.c @@ -1118,9 +1118,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");