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;