From d4649b82841e34fd2257cc3769ee21f025b18115 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 3 Oct 2021 13:22:01 +0200 Subject: [PATCH] test: clean up any lingering core file after systemf() test Signed-off-by: Joachim Wiberg --- test/systemf.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/systemf.c b/test/systemf.c index 61e178c..945f5c4 100644 --- a/test/systemf.c +++ b/test/systemf.c @@ -1,6 +1,16 @@ #include #include "check.h" +/* + * Depending on the system and default shell, `kill -QUIT $$` (below) + * may leave a core file, so we need to clean that up here to prevent + * the distcleancheck target from failing. + */ +static void cleanup(void) +{ + remove("core"); +} + int main(void) { struct { char *cmd; int rc; } list[] = { @@ -12,6 +22,8 @@ int main(void) { "kill -INT $$", -1 } }; + atexit(cleanup); + for (size_t i = 0; i < NELEMS(list); i++) { int rc;