Exemplo n.º 1
0
static int
volicon_readlink(const char *path, char *buf, size_t size)
{
    ERROR_IF_MAGIC_FILE(path, EINVAL);

    return fuse_fs_readlink(volicon_get()->next, path, buf, size);
}
Exemplo n.º 2
0
static int subdir_readlink(const char *path, char *buf, size_t size)
{
	struct subdir *d = subdir_get();
	char *newpath;
	int err = subdir_addpath(d, path, &newpath);
	if (!err) {
		err = fuse_fs_readlink(d->next, newpath, buf, size);
		if (!err && d->rellinks)
			transform_symlink(d, newpath, buf, size);
		free(newpath);
	}
	return err;
}
Exemplo n.º 3
0
static int iconv_readlink(const char *path, char *buf, size_t size)
{
	struct iconv *ic = iconv_get();
	char *newpath;
	int err = iconv_convpath(ic, path, &newpath, 0);
	if (!err) {
		err = fuse_fs_readlink(ic->next, newpath, buf, size);
		if (!err) {
			char *newlink;
			err = iconv_convpath(ic, buf, &newlink, 1);
			if (!err) {
				strncpy(buf, newlink, size - 1);
				buf[size - 1] = '\0';
				free(newlink);
			}
		}
		free(newpath);
	}
	return err;
}