[x265] [PATCH 1 of 5] cli: use sig_atomic_t type for variable modified by SIGINT handler

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


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1379521787 18000
#      Wed Sep 18 11:29:47 2013 -0500
# Node ID e34d5dec483e0870265e8b783387faa13ec2745c
# Parent  d05f4310a976482e8221f8ba2bde5c53229eea67
cli: use sig_atomic_t type for variable modified by SIGINT handler

Other nits:
* removed unused b_exit_on_ctrl_c
* removed unnecessary static initializer

diff -r d05f4310a976 -r e34d5dec483e source/x265.cpp
--- a/source/x265.cpp	Tue Sep 17 00:13:08 2013 +0530
+++ b/source/x265.cpp	Wed Sep 18 11:29:47 2013 -0500
@@ -77,12 +77,9 @@
 #endif
 
 /* Ctrl-C handler */
-static volatile int b_ctrl_c = 0;
-static int          b_exit_on_ctrl_c = 0;
+static volatile sig_atomic_t b_ctrl_c /* = 0 */;
 static void sigint_handler(int)
 {
-    if (b_exit_on_ctrl_c)
-        exit(0);
     b_ctrl_c = 1;
 }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 4037.diff
Type: text/x-patch
Size: 821 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20130918/68e2b270/attachment.bin>


More information about the x265-devel mailing list