[x265] [PATCH 5 of 5] cli: report errors from registering signal handler

Steve Borho steve at borho.org
Wed Sep 18 20:52:09 CEST 2013


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1379529318 18000
#      Wed Sep 18 13:35:18 2013 -0500
# Node ID ce8470de77cfa1480132fbfe886af2fe9c344211
# Parent  5a654d48aa996550d68d6ad85eddcf7770c3fa89
cli: report errors from registering signal handler

diff -r 5a654d48aa99 -r ce8470de77cf source/x265.cpp
--- a/source/x265.cpp	Wed Sep 18 12:39:58 2013 -0500
+++ b/source/x265.cpp	Wed Sep 18 13:35:18 2013 -0500
@@ -37,6 +37,8 @@
 #include "PPA/ppa.h"
 
 #include <signal.h>
+#include <errno.h>
+#include <fcntl.h>
 #include <getopt.h>
 #include <assert.h>
 #include <stdarg.h>
@@ -502,7 +504,8 @@
     }
 
     /* Control-C handler */
-    signal(SIGINT, sigint_handler);
+    if (signal(SIGINT, sigint_handler) == SIG_ERR)
+        cliopt.log(X265_LOG_ERROR, "Unable to register CTRL+C handler, error %d\n", errno);
 
     x265_picture_t pic_orig, pic_out;
     x265_picture_t *pic_in = &pic_orig;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4041.diff
Type: text/x-patch
Size: 921 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20130918/e2506256/attachment.bin>


More information about the x265-devel mailing list