diff --git a/ChangeLog b/ChangeLog index 53990f31a9..7d2eb56467 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-09-23 Sven Neumann + + * app/config/gimpscanner.c (gimp_scanner_new_file): workaround for + GLib bug #116617: set GimpConfigError before calling g_strerror(). + Fixes bug #122939. + 2003-09-23 Sven Neumann * app/gui/menus.c (menus_last_opened_add): add a shortcut of diff --git a/app/config/gimpscanner.c b/app/config/gimpscanner.c index 8a7862fca8..afc4b520b2 100644 --- a/app/config/gimpscanner.c +++ b/app/config/gimpscanner.c @@ -83,12 +83,16 @@ gimp_scanner_new_file (const gchar *filename, if (fd == -1) { + GimpConfigError code; + + code = (errno == ENOENT ? + GIMP_CONFIG_ERROR_OPEN_ENOENT : GIMP_CONFIG_ERROR_OPEN); + g_set_error (error, - GIMP_CONFIG_ERROR, - (errno == ENOENT ? - GIMP_CONFIG_ERROR_OPEN_ENOENT : GIMP_CONFIG_ERROR_OPEN), + GIMP_CONFIG_ERROR, code, _("Failed to open file: '%s': %s"), filename, g_strerror (errno)); + return NULL; } diff --git a/libgimpconfig/gimpscanner.c b/libgimpconfig/gimpscanner.c index 8a7862fca8..afc4b520b2 100644 --- a/libgimpconfig/gimpscanner.c +++ b/libgimpconfig/gimpscanner.c @@ -83,12 +83,16 @@ gimp_scanner_new_file (const gchar *filename, if (fd == -1) { + GimpConfigError code; + + code = (errno == ENOENT ? + GIMP_CONFIG_ERROR_OPEN_ENOENT : GIMP_CONFIG_ERROR_OPEN); + g_set_error (error, - GIMP_CONFIG_ERROR, - (errno == ENOENT ? - GIMP_CONFIG_ERROR_OPEN_ENOENT : GIMP_CONFIG_ERROR_OPEN), + GIMP_CONFIG_ERROR, code, _("Failed to open file: '%s': %s"), filename, g_strerror (errno)); + return NULL; }