From 135476e69a7e204597de119a8814baf97ee8d640 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Wed, 14 Sep 2016 23:32:45 +0800 Subject: [PATCH] run: Print errno error code consistently Commit 352e761c0ef506f42f818c1da39ae504d45fea36 started the trend to print the errno error code when unable to open a file, make all occurrences where files are opened print the same kind of message. --- common/flatpak-run.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/flatpak-run.c b/common/flatpak-run.c index af6284d8a..888f7f90b 100644 --- a/common/flatpak-run.c +++ b/common/flatpak-run.c @@ -2598,8 +2598,9 @@ flatpak_run_add_app_info_args (GPtrArray *argv_array, fd = g_file_open_tmp ("flatpak-context-XXXXXX", &tmp_path, NULL); if (fd < 0) { - g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (errno), - _("Failed to open flatpak-info temp file")); + int errsv = errno; + g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv), + _("Failed to open flatpak-info temp file: %s"), g_strerror (errsv)); return FALSE; } @@ -2625,8 +2626,9 @@ flatpak_run_add_app_info_args (GPtrArray *argv_array, fd = open (tmp_path, O_RDONLY); if (fd == -1) { - g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (errno), - _("Failed to open temp file")); + int errsv = errno; + g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errsv), + _("Failed to open temp file: %s"), g_strerror (errsv)); return FALSE; }