"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "example/cuse.c" between
fuse-3.10.3.tar.xz and fuse-3.10.4.tar.xz

About: FUSE (Filesystem in Userspace) is a simple interface for userspace programs to export a virtual filesystem to the linux kernel.

cuse.c  (fuse-3.10.3.tar.xz):cuse.c  (fuse-3.10.4.tar.xz)
skipping to change at line 296 skipping to change at line 296
.ioctl = cusexmp_ioctl, .ioctl = cusexmp_ioctl,
}; };
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
struct fuse_args args = FUSE_ARGS_INIT(argc, argv); struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
struct cusexmp_param param = { 0, 0, NULL, 0 }; struct cusexmp_param param = { 0, 0, NULL, 0 };
char dev_name[128] = "DEVNAME="; char dev_name[128] = "DEVNAME=";
const char *dev_info_argv[] = { dev_name }; const char *dev_info_argv[] = { dev_name };
struct cuse_info ci; struct cuse_info ci;
int ret = 1;
if (fuse_opt_parse(&args, &param, cusexmp_opts, cusexmp_process_arg)) { if (fuse_opt_parse(&args, &param, cusexmp_opts, cusexmp_process_arg)) {
printf("failed to parse option\n"); printf("failed to parse option\n");
return 1; free(param.dev_name);
goto out;
} }
if (!param.is_help) { if (!param.is_help) {
if (!param.dev_name) { if (!param.dev_name) {
fprintf(stderr, "Error: device name missing\n"); fprintf(stderr, "Error: device name missing\n");
return 1; goto out;
} }
strncat(dev_name, param.dev_name, sizeof(dev_name) - 9); strncat(dev_name, param.dev_name, sizeof(dev_name) - sizeof("DEVN
AME="));
free(param.dev_name);
} }
memset(&ci, 0, sizeof(ci)); memset(&ci, 0, sizeof(ci));
ci.dev_major = param.major; ci.dev_major = param.major;
ci.dev_minor = param.minor; ci.dev_minor = param.minor;
ci.dev_info_argc = 1; ci.dev_info_argc = 1;
ci.dev_info_argv = dev_info_argv; ci.dev_info_argv = dev_info_argv;
ci.flags = CUSE_UNRESTRICTED_IOCTL; ci.flags = CUSE_UNRESTRICTED_IOCTL;
return cuse_lowlevel_main(args.argc, args.argv, &ci, &cusexmp_clop, ret = cuse_lowlevel_main(args.argc, args.argv, &ci, &cusexmp_clop, NULL);
NULL);
out:
fuse_opt_free_args(&args);
return ret;
} }
 End of changes. 5 change blocks. 
5 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)