]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
trap: Allow chdir /tmp even if prctl not supported.
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Mon, 1 Oct 2018 15:57:36 +0000 (16:57 +0100)
committerperexg <perex@perex.cz>
Tue, 2 Oct 2018 14:04:06 +0000 (16:04 +0200)
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.

src/main.c

index 24e53acebca4581b7df61c9049a21cb186a0da4c..21abc93bbea3ad63d250d44ac4ee9e275ebbba7b 100644 (file)
@@ -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");