[x265] [PATCH 2 of 2] Do not use logging in a signal handler

Andrey Semashev andrey.semashev at gmail.com
Wed Jan 10 16:20:18 CET 2018


# HG changeset patch
# User Andrey Semashev <andrey.semashev at gmail.com>
# Date 1515597241 -10800
#      Wed Jan 10 18:14:01 2018 +0300
# Branch add_custom_logging
# Node ID fbd3aa7b346e337bc5fefb4f2e51fb74c2ded597
# Parent  a5ad2f32cd45697897fdf6b643c69291861520c7
Do not use logging in a signal handler.

Signal handlers can only call signal-safe functions, which the default logging
function is not (it uses a lot of unsafe C functions). User-specified logging
functions are also unlikely to be prepared to be called from a signal handler.

diff -r a5ad2f32cd45 -r fbd3aa7b346e source/output/reconplay.cpp
--- a/source/output/reconplay.cpp	Wed Jan 10 18:09:07 2018 +0300
+++ b/source/output/reconplay.cpp	Wed Jan 10 18:14:01 2018 +0300
@@ -42,8 +42,6 @@
 #ifndef _WIN32
 static void sigpipe_handler(int)
 {
-    if (ReconPlay::pipeValid)
-        g_x265_log(NULL, "exec", false, X265_LOG_ERROR, "pipe closed\n");
     ReconPlay::pipeValid = false;
 }
 #endif


More information about the x265-devel mailing list