[FFmpeg-cvslog] bktr: Use memset(0) instead of zero initialization for struct sigaction

Diego Biurrun git at videolan.org
Fri Mar 24 13:41:40 EET 2017


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Fri Oct 21 14:17:07 2016 +0200| [2f806622e1270d3ed1d41a53049a19673dafbe70] | committer: Diego Biurrun

bktr: Use memset(0) instead of zero initialization for struct sigaction

sigaction is not defined in standards as a struct starting with another
struct. Some *BSD variants do however, resulting in a warning from the
zero initialization, which this change eliminates.

This partially reverts a92be9b856bd11b081041c43c25d442028fe9a63.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2f806622e1270d3ed1d41a53049a19673dafbe70
---

 libavdevice/bktr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c
index f76a163..d91a60f 100644
--- a/libavdevice/bktr.c
+++ b/libavdevice/bktr.c
@@ -104,7 +104,7 @@ static av_cold int bktr_init(const char *video_device, int width, int height,
     long ioctl_frequency;
     char *arg;
     int c;
-    struct sigaction act = { 0 }, old;
+    struct sigaction act, old;
     int ret;
     char errbuf[128];
 
@@ -135,6 +135,7 @@ static av_cold int bktr_init(const char *video_device, int width, int height,
             frequency = 0.0;
     }
 
+    memset(&act, 0, sizeof(act));
     sigemptyset(&act.sa_mask);
     act.sa_handler = catchsignal;
     sigaction(SIGUSR1, &act, &old);



More information about the ffmpeg-cvslog mailing list