mirror of
https://github.com/troglobit/libite.git
synced 2026-11-13 17:01:18 +00: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 parent
3d2a975f11
commit
d4649b8284
1 file changed
+12
@@ -1,6 +1,16 @@
|
|||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include "check.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)
|
int main(void)
|
||||||
{
|
{
|
||||||
struct { char *cmd; int rc; } list[] = {
|
struct { char *cmd; int rc; } list[] = {
|
||||||
@@ -12,6 +22,8 @@ int main(void)
|
|||||||
{ "kill -INT $$", -1 }
|
{ "kill -INT $$", -1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
atexit(cleanup);
|
||||||
|
|
||||||
for (size_t i = 0; i < NELEMS(list); i++) {
|
for (size_t i = 0; i < NELEMS(list); i++) {
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user