Overview
Comment: | Implemented basic close mechanism |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
e236f4717a9453a6eb08312a83040bb4 |
User & Date: | rkeene on 2014-09-10 07:52:40 |
Other Links: | manifest | tags |
Context
2014-09-10
| ||
07:54 | Updated to not leak file descriptors for invalid sites check-in: 16162d46b5 user: rkeene tags: trunk | |
07:52 | Implemented basic close mechanism check-in: e236f4717a user: rkeene tags: trunk | |
07:47 | Removed dead code check-in: fdd60b8c90 user: rkeene tags: trunk | |
Changes
Modified appfsd.c from [3805f48036] to [343214a386].
778 778 return(-EIO); 779 779 } 780 780 781 781 fi->fh = fh; 782 782 783 783 return(0); 784 784 } 785 + 786 +static int appfs_fuse_close(const char *path, struct fuse_file_info *fi) { 787 + int close_ret; 788 + 789 + close_ret = close(fi->fh); 790 + if (close_ret != 0) { 791 + return(-EIO); 792 + } 793 + 794 + return(0); 795 +} 785 796 786 797 static int appfs_fuse_read(const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi) { 787 798 off_t lseek_ret; 788 799 ssize_t read_ret; 789 800 790 801 APPFS_DEBUG("Enter (path = %s, ...)", path); 791 802 ................................................................................ 796 807 797 808 read_ret = read(fi->fh, buf, size); 798 809 799 810 return(read_ret); 800 811 } 801 812 802 813 static struct fuse_operations appfs_oper = { 803 - .getattr = appfs_fuse_getattr, 804 - .readdir = appfs_fuse_readdir, 805 - .open = appfs_fuse_open, 806 - .read = appfs_fuse_read 814 + .getattr = appfs_fuse_getattr, 815 + .readdir = appfs_fuse_readdir, 816 + .open = appfs_fuse_open, 817 + .release = appfs_fuse_close, 818 + .read = appfs_fuse_read 807 819 }; 808 820 809 821 int main(int argc, char **argv) { 810 822 const char *cachedir = APPFS_CACHEDIR; 811 823 char dbfilename[1024]; 812 824 int pthread_ret, snprintf_ret, sqlite_ret; 813 825