From b540f4cad0da34e875dd54994c3f12d9ac25c9e7 Mon Sep 17 00:00:00 2001 From: "E.Smith" <31170571+azlm8t@users.noreply.github.com> Date: Mon, 1 Oct 2018 16:57:36 +0100 Subject: [PATCH] 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. --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); -- 2.47.3