From 6a6070c86200a8a764ff44e69a1aa2d7f987aaa5 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 14 Apr 2025 10:46:35 +0200 Subject: [PATCH] v4l2: use strerror_s instead of GNU variant there is also incompatible XSI variant of strerror_r --- src/v4l2_common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/v4l2_common.h b/src/v4l2_common.h index ad454217c..a5a343151 100644 --- a/src/v4l2_common.h +++ b/src/v4l2_common.h @@ -46,6 +46,7 @@ #include #include "types.h" +#include "compat/strings.h" // for strerror_s #define V4L2_PROBE_MAX 64 @@ -171,8 +172,9 @@ static int try_open_v4l2_device(int log_level, const char *dev_name, int cap) { int fd = open(dev_name, O_RDWR); if (fd == -1) { char errbuf[1024]; + strerror_s(errbuf, sizeof errbuf, errno); log_msg(log_level, MOD_NAME "Unable to open input device %s: %s\n", - dev_name, strerror_r(errno, errbuf, sizeof errbuf)); + dev_name, errbuf); return -1; }