summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-08-24 05:38:31 +0200
committerBastien Nocera <hadess@hadess.net>2013-09-05 13:47:41 -0300
commit870b672bb28e4c8cf4ba86075ba24b4dd5b85f42 (patch)
tree0098f8477d9ae1f9fe6ce55803f9559a66d5ded6
parent1c1a7c15029176928534d28fb1fb5f17adf7c776 (diff)
downloadlibgsystem-870b672bb28e4c8cf4ba86075ba24b4dd5b85f42.tar.gz
gs_file_read_noatime: Always return errors
When passed an invalid GFile, or one that's not FUSE backed, we should error out properly instead of not returning an error. https://bugzilla.gnome.org/show_bug.cgi?id=699252
-rw-r--r--gsystem-file-utils.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gsystem-file-utils.c b/gsystem-file-utils.c
index babae9d..f70239c 100644
--- a/gsystem-file-utils.c
+++ b/gsystem-file-utils.c
@@ -118,7 +118,14 @@ gs_file_read_noatime (GFile *file,
path = gs_file_get_path_cached (file);
if (path == NULL)
- return NULL;
+ {
+ char *uri;
+ uri = g_file_get_uri (file);
+ g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOENT,
+ "%s has no associated path", uri);
+ g_free (uri);
+ return NULL;
+ }
fd = _open_fd_noatime (path);
if (fd < 0)