shithub: sox

Download patch

ref: f536154664e98213f2079f23d55787afac01f72d
parent: 109b7aaaf6da11e010751802ade2e7e3bf506deb
author: rrt <rrt>
date: Thu Aug 23 18:05:27 EDT 2007

Don't trap SIGTERM.

If we only have one input file, then SIGINT quits immediately.

Make some 0's that should be NULL's into NULL.

--- a/src/sox.c
+++ b/src/sox.c
@@ -1193,8 +1193,11 @@
 static void sigint(int s)
 {
   static struct timeval then;
-  if (input_count > 1 && show_progress && s == SIGINT && combine_method <= sox_concatenate &&
-      since(&then, 1., sox_true))
+  if (input_count <= 1) {
+    fprintf(stderr, "Aborted.\n");
+    exit(0);
+  } else if (show_progress && s == SIGINT && combine_method <= sox_concatenate &&
+             since(&then, 1.0, sox_true))
     user_skip = sox_true;
   else user_abort = sox_true;
 }
@@ -1345,7 +1348,7 @@
 static sox_effect_handler_t const * output_effect_fn(void)
 {
   static sox_effect_handler_t handler = {
-    "output", 0, SOX_EFF_MCHAN, 0, 0, output_flow, 0, 0, 0
+    "output", 0, SOX_EFF_MCHAN, NULL, NULL, output_flow, NULL, NULL, NULL
   };
   return &handler;
 }
@@ -1583,7 +1586,6 @@
   optimize_trim();
 
   signal(SIGINT, sigint);
-  signal(SIGTERM, sigint);
 
   flowstatus = sox_flow_effects(update_status);