diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2008-02-08 17:22:15 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2008-02-08 17:22:15 +0000 |
commit | 30ece080006087a7e615cce3f7fc51b6d8a5d5bf (patch) | |
tree | 5d60a4679f82a1bb941356278d87abe2b9560d1b /lib/modules/iconv.c | |
parent | b20d88bbbc6e5ae67f0c99595859fd653949a3aa (diff) | |
download | libfuse-30ece080006087a7e615cce3f7fc51b6d8a5d5bf.tar.gz |
Support receiving file handle from kernel in GETATTR request; Allow operations with a NULL path argument, if the filesystem supports it
Diffstat (limited to 'lib/modules/iconv.c')
-rw-r--r-- | lib/modules/iconv.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/modules/iconv.c b/lib/modules/iconv.c index c0e2b80..409cb66 100644 --- a/lib/modules/iconv.c +++ b/lib/modules/iconv.c @@ -42,17 +42,27 @@ static struct iconv *iconv_get(void) static int iconv_convpath(struct iconv *ic, const char *path, char **newpathp, int fromfs) { - size_t pathlen = strlen(path); - size_t newpathlen = pathlen * 4; - char *newpath = malloc(newpathlen + 1); - size_t plen = newpathlen; - char *p = newpath; + size_t pathlen; + size_t newpathlen; + char *newpath; + size_t plen; + char *p; size_t res; int err; + if (path == NULL) { + *newpathp = NULL; + return 0; + } + + pathlen = strlen(path); + newpathlen = pathlen * 4; + newpath = malloc(newpathlen + 1); if (!newpath) return -ENOMEM; + plen = newpathlen; + p = newpath; pthread_mutex_lock(&ic->lock); do { res = iconv(fromfs ? ic->fromfs : ic->tofs, (char **) &path, @@ -607,6 +617,8 @@ static struct fuse_operations iconv_oper = { .removexattr = iconv_removexattr, .lock = iconv_lock, .bmap = iconv_bmap, + + .flag_nullpath_ok = 1, }; static struct fuse_opt iconv_opts[] = { |