From 3cdfaa1b7a5cb91ff64b61fb85820198a6e8669e Mon Sep 17 00:00:00 2001 From: Javier Date: Thu, 12 Feb 2015 01:01:58 +0100 Subject: properly return enoent for nonexisting files --- src/volumesfs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/volumesfs.c') diff --git a/src/volumesfs.c b/src/volumesfs.c index dc67f77..4226b94 100644 --- a/src/volumesfs.c +++ b/src/volumesfs.c @@ -98,8 +98,15 @@ static int volumesfs_getattr(const char *path, struct stat *stbuf) stbuf->st_mode = S_IFDIR | 0755; stbuf->st_nlink = 2; } else { - stbuf->st_mode = S_IFLNK | 0444; - stbuf->st_nlink = 1; + G_LOCK(mounts); + const gchar *mountpoint = g_hash_table_lookup(mounts, path + 1); + G_UNLOCK(mounts); + if (mountpoint) { + stbuf->st_mode = S_IFLNK | 0444; + stbuf->st_nlink = 1; + } else { + return -ENOENT; + } } return 0; } -- cgit v1.2.3