ref: 47571de9dfaf45169a8bc2b89c984819e3a98649
parent: 62a40f5df3068948d9ad45902db0f1a994574a32
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri May 4 09:39:06 EDT 2018
[ar] Remove temporary files in signal handler Remove(3) cannot be called in the context of a signal handler, but it is the only interface that we have in C99 to remove a file.
--- a/ar/main.c
+++ b/ar/main.c
@@ -50,10 +50,17 @@
}
}
+/*
+ * I do know that you cannot call remove from a signal handler
+ * but we only can use stdio function to deal with files
+ * because we are C99 compliant, and it is very likely that
+ * remove is going to work in this case
+ */
static void
sigfun(int signum)
{
- exit(1);
+ cleanup();
+ _Exit(1);
}
static FILE *