shithub: sox

Download patch

ref: 93a1dcdeb18791f48a4bd0fe48f10e49c380460d
parent: e0148bb903bb7078bae0e79487d0d1671a6e40c0
author: rrt <rrt>
date: Mon Aug 27 20:36:27 EDT 2007

Revert signal handling change.

--- a/src/sox.c
+++ b/src/sox.c
@@ -1193,10 +1193,7 @@
 static void sigint(int s)
 {
   static struct timeval then;
-  if (input_count <= 1) {
-    fprintf(stderr, "Aborted.\n");
-    exit(0);
-  } else if (show_progress && s == SIGINT && combine_method <= sox_concatenate &&
+  if (input_count > 1 && show_progress && s == SIGINT && combine_method <= sox_concatenate &&
              since(&then, 1.0, sox_true))
     user_skip = sox_true;
   else user_abort = sox_true;
@@ -1586,7 +1583,9 @@
   optimize_trim();
 
   signal(SIGINT, sigint);
-
+  /* FIXME: For SIGTERM at least we really should guarantee to stop quickly */
+  signal(SIGTERM, sigint); /* Stop gracefully even in extremis */
+  
   flowstatus = sox_flow_effects(update_status);
 
   sox_stop_effects();