From a9eca12b0b5c1f342151a9920b57d5f6a3d3a5f6 Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sat, 2 Feb 2019 12:34:07 +0100 Subject: [PATCH] added basic implementation of low level loop --- src/wsfs/operations.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/wsfs/operations.c b/src/wsfs/operations.c index c28380f..2602667 100644 --- a/src/wsfs/operations.c +++ b/src/wsfs/operations.c @@ -41,8 +41,8 @@ int wsfs_operations_loop( } int wsfs_operations_loop_ll( - char * WSFS_UNUSED_PARAM(mount_point), - struct wsfs_jsonrpc * WSFS_UNUSED_PARAM(rpc)) + char * mount_point, + struct wsfs_jsonrpc * rpc) { struct fuse_lowlevel_ops operations; memset(&operations, 0, sizeof(struct fuse_lowlevel_ops)); @@ -53,6 +53,24 @@ int wsfs_operations_loop_ll( operations.release = &wsfs_operation_ll_close; 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; -} \ No newline at end of file +}