diff options
author | Kjetil Ørbekk <orbekk@pvv.ntnu.no> | 2008-08-15 15:11:30 +0200 |
---|---|---|
committer | Kjetil Ørbekk <orbekk@pvv.ntnu.no> | 2008-08-15 15:11:30 +0200 |
commit | 1c34d40bbd9adbb2eb651fdc2c42766aed9606de (patch) | |
tree | fc6ff1bc75e7b8f5eb04d52222bdfbbddae99b2d | |
parent | f1f72be2fef35564755a9ba27c8329750a62b1ca (diff) |
- mfs_read for /.config
-rwxr-xr-x | src/mfs_vnops.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mfs_vnops.c b/src/mfs_vnops.c index a8e01b8..48c225e 100755 --- a/src/mfs_vnops.c +++ b/src/mfs_vnops.c @@ -170,7 +170,7 @@ static int mfs_open (const char *path, struct fuse_file_info *fi) fd.found = 0; if (strcmp(path, "/.config") == 0) - return (-open("~/.mfsrc", O_RDONLY)); + return (0); int status = mfs_file_data_for_path(path, &fd); if (status != 0) @@ -204,12 +204,13 @@ static int mfs_read (const char *path, char *buf, size_t size, off_t offset, DEBUG("read: path(%s) offset(%d) size(%d)\n", path, (int)offset, (int)size); if (strcmp(path, "/.config") == 0) { -/* DEBUG("read from config, offset(%d), size(%d)\n", (int)offset, (int)size); */ -/* len = strlen(paths_info); */ -/* if (size > (len - offset)) */ -/* size = len - offset; */ -/* strncpy(buf, paths_info + offset, size); */ - return (0); + char *mfsrc = mfs_get_home_path(".mfsrc"); + int fd = open(mfsrc, O_RDONLY); + free(mfsrc); + lseek(fd, offset, SEEK_CUR); + bytes = read(fd, buf, size); + close(fd); + return (bytes); } int status = mfs_file_data_for_path(path, &fd); |