Johannes Przybilla wrote:
Therefore the non-volatile access still occurs in the signal handler.

Good catch, thanks. I installed the attached further patch; please give it a try. Signal handlers are such a pain.
diff --git a/gzip.c b/gzip.c
index 1c9bc6c..e6a7761 100644
--- a/gzip.c
+++ b/gzip.c
@@ -1074,7 +1074,7 @@ local void treat_file(iname)
 }
 
 static void
-volatile_strcpy (char volatile *dst, char const *src)
+volatile_strcpy (char volatile *dst, char const volatile *src)
 {
   while ((*dst++ = *src++))
     continue;
@@ -2131,9 +2131,11 @@ remove_output_file (bool signals_already_blocked)
   fd = remove_ofname_fd;
   if (0 <= fd)
     {
+      char fname[MAX_PATH_LEN];
       remove_ofname_fd = -1;
       close (fd);
-      xunlink (ofname);
+      volatile_strcpy (fname, remove_ofname);
+      xunlink (fname);
     }
   if (!signals_already_blocked)
     sigprocmask (SIG_SETMASK, &oldset, NULL);

Reply via email to