[FFmpeg-devel] [PATCH] ffmpeg.c: use sigterm_handler with sigpipe

Dave Rice dave at dericed.com
Thu Jan 11 23:20:04 EET 2018


From 0faa2954010feb8428542fc33aa81e898a280c88 Mon Sep 17 00:00:00 2001
From: Dave Rice <dave at dericed.com>
Date: Thu, 11 Jan 2018 15:52:36 -0500
Subject: [PATCH] ffmpeg.c: use sigterm_handler with sigpipe

Based on a suggestion by Moritz Barsnick at http://ffmpeg.org/pipermail/ffmpeg-user/2018-January/038549.html <http://ffmpeg.org/pipermail/ffmpeg-user/2018-January/038549.html>

---
 fftools/ffmpeg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 0c16e75ab0..dfcc865dcf 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -406,6 +406,7 @@ void term_init(void)
 
     signal(SIGINT , sigterm_handler); /* Interrupt (ANSI).    */
     signal(SIGTERM, sigterm_handler); /* Termination (ANSI).  */
+    signal(SIGPIPE, sigterm_handler); /* Termination (pipe closed).  */
 #ifdef SIGXCPU
     signal(SIGXCPU, sigterm_handler);
 #endif
-- 
2.15.1


More information about the ffmpeg-devel mailing list