This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[patch] handle core file names without a pid suffix
- From: Matthias Klose <doko at ubuntu dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Mon, 06 Jan 2014 19:59:32 +0100
- Subject: [patch] handle core file names without a pid suffix
The following fix is needed when /proc/sys/kernel/core_uses_pid is set to 0. try
to rename the core file, and if it does still fail, skip the test.
Matthias
--- elfutils-0.158.orig/tests/backtrace-subr.sh
+++ elfutils-0.158/tests/backtrace-subr.sh
@@ -111,6 +111,11 @@ check_native_core()
# Skip the test if we cannot adjust core ulimit.
core="core.`ulimit -c unlimited || exit 77; set +ex; testrun
${abs_builddir}/$child --gencore; true`"
+ # see if /proc/sys/kernel/core_uses_pid is set to 0
+ if [ -f core ]; then
+ mv core "$core"
+ fi
+ if [ ! -f "$core" ]; then exit 77; fi
if [ "x$SAVED_VALGRIND_CMD" != "x" ]; then
VALGRIND_CMD="$SAVED_VALGRIND_CMD"