chiark / gitweb /
disorder-normalize should wait for sox to finish. I think this is
authorRichard Kettlewell <rjk@greenend.org.uk>
Fri, 21 Dec 2007 14:55:59 +0000 (14:55 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Fri, 21 Dec 2007 14:55:59 +0000 (14:55 +0000)
mostly a test-time issue: disorder-speaker doesn't care about program
termination, just whether it gets the audio data.

server/normalize.c

index 87b0f3d7bc5c356419d60e4f4d6e5a391ca5b465..28faa8168ba9d55ef95fbd1c16ceb34fce592110 100644 (file)
@@ -249,6 +249,13 @@ int main(int argc, char attribute((unused)) **argv) {
   }
   if(outfd != -1)
     xclose(outfd);
+  if(pid != -1) {
+    /* There's still a converter running */
+    if(waitpid(pid, &n, 0) < 0)
+      fatal(errno, "error calling waitpid");
+    if(n)
+      fatal(0, "sox failed: %#x", n);
+  }
   return 0;
 }