mirror of
https://github.com/troglobit/libite.git
synced 2026-10-01 05:22:34 +07:00
test: clean up any lingering core file after systemf() test
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
#include <err.h>
|
||||
#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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user