workaround for GLib bug #116617: set GimpConfigError before calling

2003-09-23  Sven Neumann  <sven@gimp.org>

	* app/config/gimpscanner.c (gimp_scanner_new_file): workaround for
	GLib bug #116617: set GimpConfigError before calling g_strerror().
	Fixes bug #122939.
This commit is contained in:
Sven Neumann 2003-09-23 15:22:30 +00:00 committed by Sven Neumann
parent f55261c2c1
commit a06c96e5bc
3 changed files with 20 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2003-09-23 Sven Neumann <sven@gimp.org>
* 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 <sven@gimp.org>
* app/gui/menus.c (menus_last_opened_add): add a shortcut of

View File

@ -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;
}

View File

@ -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;
}