summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2008-06-19 12:47:48 +0000
committerChristian Persch <chpe@src.gnome.org>2008-06-19 12:47:48 +0000
commit446f41757b425441976e5a2b32c233f64036e6ff (patch)
treee5c7f9043eee1d0378dee141d90ceab4db21db0f /tests
parent1a30e12586de407b88b003b2f2599a599a9527f5 (diff)
downloadgtk+-446f41757b425441976e5a2b32c233f64036e6ff.tar.gz
Use g_set_error_literal where appropriate. Bug #538640.
svn path=/trunk/; revision=20463
Diffstat (limited to 'tests')
-rw-r--r--tests/testfilechooser.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c
index 4164d739b2..47e8ce76de 100644
--- a/tests/testfilechooser.c
+++ b/tests/testfilechooser.c
@@ -199,11 +199,13 @@ my_new_from_file_at_size (const char *filename,
g_return_val_if_fail (width > 0 && height > 0, NULL);
if (stat (filename, &st) != 0) {
+ int errsv = errno;
+
g_set_error (error,
G_FILE_ERROR,
- g_file_error_from_errno (errno),
+ g_file_error_from_errno (errsv),
_("Could not get information for file '%s': %s"),
- filename, g_strerror (errno));
+ filename, g_strerror (errsv));
return NULL;
}
@@ -212,11 +214,13 @@ my_new_from_file_at_size (const char *filename,
f = fopen (filename, "rb");
if (!f) {
+ int errsv = errno;
+
g_set_error (error,
G_FILE_ERROR,
- g_file_error_from_errno (errno),
+ g_file_error_from_errno (errsv),
_("Failed to open file '%s': %s"),
- filename, g_strerror (errno));
+ filename, g_strerror (errsv));
return NULL;
}