1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00

added basic implementation of low level loop

This commit is contained in:
Falk Werner 2019-02-02 12:34:07 +01:00
parent 32e325e72f
commit a9eca12b0b

View File

@ -41,8 +41,8 @@ int wsfs_operations_loop(
} }
int wsfs_operations_loop_ll( int wsfs_operations_loop_ll(
char * WSFS_UNUSED_PARAM(mount_point), char * mount_point,
struct wsfs_jsonrpc * WSFS_UNUSED_PARAM(rpc)) struct wsfs_jsonrpc * rpc)
{ {
struct fuse_lowlevel_ops operations; struct fuse_lowlevel_ops operations;
memset(&operations, 0, sizeof(struct fuse_lowlevel_ops)); memset(&operations, 0, sizeof(struct fuse_lowlevel_ops));
@ -53,6 +53,24 @@ int wsfs_operations_loop_ll(
operations.release = &wsfs_operation_ll_close; operations.release = &wsfs_operation_ll_close;
operations.read = &wsfs_operation_ll_read; operations.read = &wsfs_operation_ll_read;
int result = 1;
const int argc = 1;
char * argv[] = {"", NULL};
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
struct fuse_session * session = fuse_session_new(&args, &operations, sizeof(operations), rpc);
if (NULL != session)
{
fuse_set_signal_handlers(session);
result = fuse_session_mount(session, mount_point);
if (0 == result)
{
result = fuse_session_loop(session);
fuse_session_unmount(session);
}
fuse_remove_signal_handlers(session);
fuse_session_destroy(session);
}
fuse_opt_free_args(&args);
return 0; return 0;
} }