From c89aba22acdc43cebcac421c432f95f789524e08 Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Mon, 11 Jan 2021 17:15:20 +0100 Subject: [PATCH] Better error messages for open() --- io_pipeline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io_pipeline.c b/io_pipeline.c index e7b2ca9..980a722 100644 --- a/io_pipeline.c +++ b/io_pipeline.c @@ -138,7 +138,7 @@ setup_camera(MPDeviceList **device_list, const struct mp_camera_config *config) info->video_fd = open(dev_name, O_RDWR); if (info->video_fd == -1) { - g_printerr("Could not open %s\n", dev_name); + g_printerr("Could not open %s: %s\n", dev_name, strerror(errno)); exit(EXIT_FAILURE); } @@ -179,7 +179,7 @@ setup_camera(MPDeviceList **device_list, const struct mp_camera_config *config) info->fd = open(info->dev_fname, O_RDWR); if (info->fd == -1) { - g_printerr("Could not open %s\n", info->dev_fname); + g_printerr("Could not open %s: %s\n", info->dev_fname, strerror(errno)); exit(EXIT_FAILURE); }