Would it make sense to install the following patch to GNU tar?

The idea here is that I suspect that GNU tar won't work well
if random system calls fail with errno == EINTR, and this
change would help insulate tar from that issue, on platforms
that support SA_RESTART.

This change affects tar's behavior only if the
--totals=SIG option is specified, for some signal SIG.

diff --git a/src/tar.c b/src/tar.c
index 6d37044..f0d8f5b 100644
--- a/src/tar.c
+++ b/src/tar.c
@@ -956,10 +956,13 @@ static void
 stat_on_signal (int signo)
 {
 #ifdef HAVE_SIGACTION
+# ifndef SA_RESTART
+#  define SA_RESTART 0
+# endif
   struct sigaction act;
   act.sa_handler = sigstat;
   sigemptyset (&act.sa_mask);
-  act.sa_flags = 0;
+  act.sa_flags = SA_RESTART;
   sigaction (signo, &act, NULL);
 #else
   signal (signo, sigstat);

Reply via email to