subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1727916 - in /subversion/trunk/subversion: svn/svn.c svnadmin/svnadmin.c svnbench/svnbench.c svnfsfs/svnfsfs.c svnlook/svnlook.c svnrdump/svnrdump.c svnsync/svnsync.c
Date Mon, 01 Feb 2016 11:06:17 GMT
Author: philip
Date: Mon Feb  1 11:06:16 2016
New Revision: 1727916

URL: http://svn.apache.org/viewvc?rev=1727916&view=rev
Log:
Followup to r1727621, properly resend the signal for all caught signals.

* subversion/svn/svn.c
* subversion/svnadmin/svnadmin.c
* subversion/svnbench/svnbench.c
* subversion/svnfsfs/svnfsfs.c
* subversion/svnlook/svnlook.c
* subversion/svnrdump/svnrdump.c
* subversion/svnsync/svnsync.c
  (signal_handler): Store signal number.
  (main): Resend signal when signal is caught.

Modified:
    subversion/trunk/subversion/svn/svn.c
    subversion/trunk/subversion/svnadmin/svnadmin.c
    subversion/trunk/subversion/svnbench/svnbench.c
    subversion/trunk/subversion/svnfsfs/svnfsfs.c
    subversion/trunk/subversion/svnlook/svnlook.c
    subversion/trunk/subversion/svnrdump/svnrdump.c
    subversion/trunk/subversion/svnsync/svnsync.c

Modified: subversion/trunk/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/svn.c?rev=1727916&r1=1727915&r2=1727916&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Mon Feb  1 11:06:16 2016
@@ -1803,6 +1803,7 @@ check_lib_versions(void)
 
 /* A flag to see if we've been cancelled by the client or not. */
 static volatile sig_atomic_t cancelled = FALSE;
+static int signum_cancelled;
 
 /* A signal handler to support cancellation. */
 static void
@@ -1810,6 +1811,7 @@ signal_handler(int signum)
 {
   apr_signal(signum, SIG_IGN);
   cancelled = TRUE;
+  signum_cancelled = signum;
 }
 
 /* Our cancellation callback. */
@@ -3149,12 +3151,15 @@ main(int argc, const char *argv[])
   svn_pool_destroy(pool);
 
 #ifndef WIN32
-  /* If cancelled by SIGINT then attempt to exit via SIGINT.  This
+  /* Resend any signal as this may cause the program to exit and
      allows the shell to use WIFSIGNALED and WTERMSIG to detect the
-     SIGINT.  See http://www.cons.org/cracauer/sigint.html  */
-  if (cancelled && apr_signal(SIGINT, SIG_DFL) == APR_SUCCESS)
-    /* No APR support for getpid() so cannot use apr_proc_kill(). */
-    kill(getpid(), SIGINT);
+     signal.  See http://www.cons.org/cracauer/sigint.html */
+  if (cancelled)
+    {
+      apr_signal(signum_cancelled, SIG_DFL);
+      /* No APR support for getpid() so cannot use apr_proc_kill(). */
+      kill(getpid(), signum_cancelled);
+    }
 #endif
 
   return exit_code;

Modified: subversion/trunk/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/svnadmin.c?rev=1727916&r1=1727915&r2=1727916&view=diff
==============================================================================
--- subversion/trunk/subversion/svnadmin/svnadmin.c (original)
+++ subversion/trunk/subversion/svnadmin/svnadmin.c Mon Feb  1 11:06:16 2016
@@ -66,6 +66,7 @@
 
 /* A flag to see if we've been cancelled by the client or not. */
 static volatile sig_atomic_t cancelled = FALSE;
+static int signum_cancelled;
 
 /* A signal handler to support cancellation. */
 static void
@@ -73,6 +74,7 @@ signal_handler(int signum)
 {
   apr_signal(signum, SIG_IGN);
   cancelled = TRUE;
+  signum_cancelled = signum;
 }
 
 
@@ -3037,12 +3039,15 @@ main(int argc, const char *argv[])
   svn_pool_destroy(pool);
 
 #ifndef WIN32
-  /* If cancelled by SIGINT then attempt to exit via SIGINT.  This
+  /* Resend any signal as this may cause the program to exit and
      allows the shell to use WIFSIGNALED and WTERMSIG to detect the
-     SIGINT.  See http://www.cons.org/cracauer/sigint.html  */
-  if (cancelled && apr_signal(SIGINT, SIG_DFL) == APR_SUCCESS)
-    /* No APR support for getpid() so cannot use apr_proc_kill(). */
-    kill(getpid(), SIGINT);
+     signal.  See http://www.cons.org/cracauer/sigint.html */
+  if (cancelled)
+    {
+      apr_signal(signum_cancelled, SIG_DFL);
+      /* No APR support for getpid() so cannot use apr_proc_kill(). */
+      kill(getpid(), signum_cancelled);
+    }
 #endif
 
   return exit_code;

Modified: subversion/trunk/subversion/svnbench/svnbench.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnbench/svnbench.c?rev=1727916&r1=1727915&r2=1727916&view=diff
==============================================================================
--- subversion/trunk/subversion/svnbench/svnbench.c (original)
+++ subversion/trunk/subversion/svnbench/svnbench.c Mon Feb  1 11:06:16 2016
@@ -334,6 +334,7 @@ check_lib_versions(void)
 
 /* A flag to see if we've been cancelled by the client or not. */
 static volatile sig_atomic_t cancelled = FALSE;
+static int signum_cancelled;
 
 /* A signal handler to support cancellation. */
 static void
@@ -341,6 +342,7 @@ signal_handler(int signum)
 {
   apr_signal(signum, SIG_IGN);
   cancelled = TRUE;
+  signum_cancelled = signum;
 }
 
 /* Baton for ra_progress_func() callback. */
@@ -1054,12 +1056,15 @@ main(int argc, const char *argv[])
   svn_pool_destroy(pool);
 
 #ifndef WIN32
-  /* If cancelled by SIGINT then attempt to exit via SIGINT.  This
+  /* Resend any signal as this may cause the program to exit and
      allows the shell to use WIFSIGNALED and WTERMSIG to detect the
-     SIGINT.  See http://www.cons.org/cracauer/sigint.html  */
-  if (cancelled && apr_signal(SIGINT, SIG_DFL) == APR_SUCCESS)
-    /* No APR support for getpid() so cannot use apr_proc_kill(). */
-    kill(getpid(), SIGINT);
+     signal.  See http://www.cons.org/cracauer/sigint.html */
+  if (cancelled)
+    {
+      apr_signal(signum_cancelled, SIG_DFL);
+      /* No APR support for getpid() so cannot use apr_proc_kill(). */
+      kill(getpid(), signum_cancelled);
+    }
 #endif
 
   return exit_code;

Modified: subversion/trunk/subversion/svnfsfs/svnfsfs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnfsfs/svnfsfs.c?rev=1727916&r1=1727915&r2=1727916&view=diff
==============================================================================
--- subversion/trunk/subversion/svnfsfs/svnfsfs.c (original)
+++ subversion/trunk/subversion/svnfsfs/svnfsfs.c Mon Feb  1 11:06:16 2016
@@ -49,6 +49,7 @@
 
 /* A flag to see if we've been cancelled by the client or not. */
 static volatile sig_atomic_t cancelled = FALSE;
+static int signum_cancelled;
 
 /* A signal handler to support cancellation. */
 static void
@@ -56,6 +57,7 @@ signal_handler(int signum)
 {
   apr_signal(signum, SIG_IGN);
   cancelled = TRUE;
+  signum_cancelled = signum;
 }
 
 
@@ -544,12 +546,15 @@ main(int argc, const char *argv[])
   svn_pool_destroy(pool);
 
 #ifndef WIN32
-  /* If cancelled by SIGINT then attempt to exit via SIGINT.  This
+  /* Resend any signal as this may cause the program to exit and
      allows the shell to use WIFSIGNALED and WTERMSIG to detect the
-     SIGINT.  See http://www.cons.org/cracauer/sigint.html  */
-  if (cancelled && apr_signal(SIGINT, SIG_DFL) == APR_SUCCESS)
-    /* No APR support for getpid() so cannot use apr_proc_kill(). */
-    kill(getpid(), SIGINT);
+     signal.  See http://www.cons.org/cracauer/sigint.html */
+  if (cancelled)
+    {
+      apr_signal(signum_cancelled, SIG_DFL);
+      /* No APR support for getpid() so cannot use apr_proc_kill(). */
+      kill(getpid(), signum_cancelled);
+    }
 #endif
 
   return exit_code;

Modified: subversion/trunk/subversion/svnlook/svnlook.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnlook/svnlook.c?rev=1727916&r1=1727915&r2=1727916&view=diff
==============================================================================
--- subversion/trunk/subversion/svnlook/svnlook.c (original)
+++ subversion/trunk/subversion/svnlook/svnlook.c Mon Feb  1 11:06:16 2016
@@ -381,6 +381,7 @@ typedef struct svnlook_ctxt_t
 
 /* A flag to see if we've been cancelled by the client or not. */
 static volatile sig_atomic_t cancelled = FALSE;
+static int signum_cancelled;
 
 
 /*** Helper functions. ***/
@@ -391,6 +392,7 @@ signal_handler(int signum)
 {
   apr_signal(signum, SIG_IGN);
   cancelled = TRUE;
+  signum_cancelled = signum;
 }
 
 /* Our cancellation callback. */
@@ -2890,12 +2892,15 @@ main(int argc, const char *argv[])
   svn_pool_destroy(pool);
 
 #ifndef WIN32
-  /* If cancelled by SIGINT then attempt to exit via SIGINT.  This
+  /* Resend any signal as this may cause the program to exit and
      allows the shell to use WIFSIGNALED and WTERMSIG to detect the
-     SIGINT.  See http://www.cons.org/cracauer/sigint.html  */
-  if (cancelled && apr_signal(SIGINT, SIG_DFL) == APR_SUCCESS)
-    /* No APR support for getpid() so cannot use apr_proc_kill(). */
-    kill(getpid(), SIGINT);
+     signal.  See http://www.cons.org/cracauer/sigint.html */
+  if (cancelled)
+    {
+      apr_signal(signum_cancelled, SIG_DFL);
+      /* No APR support for getpid() so cannot use apr_proc_kill(). */
+      kill(getpid(), signum_cancelled);
+    }
 #endif
 
   return exit_code;

Modified: subversion/trunk/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/svnrdump.c?rev=1727916&r1=1727915&r2=1727916&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/svnrdump.c (original)
+++ subversion/trunk/subversion/svnrdump/svnrdump.c Mon Feb  1 11:06:16 2016
@@ -54,6 +54,7 @@
 
 /* A flag to see if we've been cancelled by the client or not. */
 static volatile sig_atomic_t cancelled = FALSE;
+static int signum_cancelled;
 
 /* A signal handler to support cancellation. */
 static void
@@ -61,6 +62,7 @@ signal_handler(int signum)
 {
   apr_signal(signum, SIG_IGN);
   cancelled = TRUE;
+  signum_cancelled = signum;
 }
 
 /* Our cancellation callback. */
@@ -1164,12 +1166,15 @@ main(int argc, const char *argv[])
   svn_pool_destroy(pool);
 
 #ifndef WIN32
-  /* If cancelled by SIGINT then attempt to exit via SIGINT.  This
+  /* Resend any signal as this may cause the program to exit and
      allows the shell to use WIFSIGNALED and WTERMSIG to detect the
-     SIGINT.  See http://www.cons.org/cracauer/sigint.html  */
-  if (cancelled && apr_signal(SIGINT, SIG_DFL) == APR_SUCCESS)
-    /* No APR support for getpid() so cannot use apr_proc_kill(). */
-    kill(getpid(), SIGINT);
+     signal.  See http://www.cons.org/cracauer/sigint.html */
+  if (cancelled)
+    {
+      apr_signal(signum_cancelled, SIG_DFL);
+      /* No APR support for getpid() so cannot use apr_proc_kill(). */
+      kill(getpid(), signum_cancelled);
+    }
 #endif
 
   return exit_code;

Modified: subversion/trunk/subversion/svnsync/svnsync.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnsync/svnsync.c?rev=1727916&r1=1727915&r2=1727916&view=diff
==============================================================================
--- subversion/trunk/subversion/svnsync/svnsync.c (original)
+++ subversion/trunk/subversion/svnsync/svnsync.c Mon Feb  1 11:06:16 2016
@@ -331,6 +331,7 @@ typedef struct opt_baton_t {
 
 /* Global record of whether the user has requested cancellation. */
 static volatile sig_atomic_t cancelled = FALSE;
+static int signum_cancelled;
 
 
 /* Callback function for apr_signal(). */
@@ -339,6 +340,7 @@ signal_handler(int signum)
 {
   apr_signal(signum, SIG_IGN);
   cancelled = TRUE;
+  signum_cancelled = signum;
 }
 
 
@@ -2477,12 +2479,15 @@ main(int argc, const char *argv[])
   svn_pool_destroy(pool);
 
 #ifndef WIN32
-  /* If cancelled by SIGINT then attempt to exit via SIGINT.  This
+  /* Resend any signal as this may cause the program to exit and
      allows the shell to use WIFSIGNALED and WTERMSIG to detect the
-     SIGINT.  See http://www.cons.org/cracauer/sigint.html  */
-  if (cancelled && apr_signal(SIGINT, SIG_DFL) == APR_SUCCESS)
-    /* No APR support for getpid() so cannot use apr_proc_kill(). */
-    kill(getpid(), SIGINT);
+     signal.  See http://www.cons.org/cracauer/sigint.html */
+  if (cancelled)
+    {
+      apr_signal(signum_cancelled, SIG_DFL);
+      /* No APR support for getpid() so cannot use apr_proc_kill(). */
+      kill(getpid(), signum_cancelled);
+    }
 #endif
 
   return exit_code;



Mime
View raw message