From 4799ba57707884a7d451434daa211eff2330678a Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Tue, 3 Jul 2012 14:23:21 +0300 Subject: Use NAME_MAX if pathconf fails. Apparently it's not rare. --- src/bindfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/bindfs.c b/src/bindfs.c index ce22825..1726adf 100644 --- a/src/bindfs.c +++ b/src/bindfs.c @@ -405,9 +405,7 @@ static int bindfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, pc_ret = pathconf(path, _PC_NAME_MAX); if (pc_ret < 0) { DPRINTF("pathconf failed: %s (%d)", strerror(errno), errno); - /* Could use NAME_MAX but it may not be safe if the underlying - * FS is NFS or similar. */ - return -errno; + pc_ret = NAME_MAX; } de_buf = malloc(offsetof(struct dirent, d_name) + pc_ret + 1); -- cgit v1.2.3