]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
blindfix for Visual : minor casting issue
authorYann Collet <cyan@fb.com>
Sun, 1 Oct 2017 22:32:48 +0000 (15:32 -0700)
committerYann Collet <cyan@fb.com>
Sun, 1 Oct 2017 22:32:48 +0000 (15:32 -0700)
should not happen since SIGIGN is provided by <signal.h>,
so it should work "ouf of the box"

programs/fileio.c

index 83934beef6aa57e0ce7ff1ace5ad6a0d5301f596..e22d2bac8d05797987d6823555eb790173ffa771 100644 (file)
@@ -145,13 +145,15 @@ static clock_t g_time = 0;
 **************************************/
 #include  <signal.h>
 
+typedef void (*signalHandler_f) (int);
 const char* g_artefact = NULL;
 void INThandler(int sig)
 {
-    signal(sig, SIG_IGN);
-    remove(g_artefact);
+    assert(sig==SIGINT);
+    signal(sig, (signalHandler_f)SIG_IGN);  /* cast required to circumvent a bug in Visual Studio 2008 */
+    if (g_artefact) remove(g_artefact);
     DISPLAY("\n");
-    exit(1);
+    exit(2);
 }