From d847ef864b2e8a14af0b2b4c926c1cd33768948c Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 25 Jul 2019 10:09:11 -0400 Subject: [PATCH] cli: fix "permission denied" test after g_dir_open When changing from opendir/readdir to g_dir_open/g_dir_read_name, I forgot this check from reading errno to reading the error output variable. Change-Id: I95e22531c20ec90df0bc517bbf666f5698cddd15 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/1781 Reviewed-by: Philippe Proulx --- src/cli/babeltrace2-cfg-src-auto-disc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/babeltrace2-cfg-src-auto-disc.c b/src/cli/babeltrace2-cfg-src-auto-disc.c index 6dcb9e2c..6b1b4563 100644 --- a/src/cli/babeltrace2-cfg-src-auto-disc.c +++ b/src/cli/babeltrace2-cfg-src-auto-disc.c @@ -525,7 +525,7 @@ int auto_discover_source_for_input_as_dir_or_file_rec(GString *input, const char *fmt = "Failed to open directory %s: %s"; BT_LOGW(fmt, input->str, error->message); - if (errno == EACCES) { + if (error->code == G_FILE_ERROR_ACCES) { /* This is not a fatal error, we just skip it. */ status = 1; goto end; -- 2.34.1