Skip to content

Commit

Permalink
Merge PR #14: Switch to libfuse3
Browse files Browse the repository at this point in the history
  • Loading branch information
davidebeatrici authored Aug 31, 2024
2 parents 2f66b45 + 2090d9f commit 05d8179
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install packages
run: sudo apt-get install -y cmake
ninja-build
libfuse-dev
libfuse3-dev
libasound-dev
libpulse-dev

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if(daemon)
add_executable(osspd "osspd.c")
set_output_dir(osspd)

link_pkg(osspd "fuse")
link_pkg(osspd "fuse3")
target_link_libraries(osspd PRIVATE libossp)

install_daemon(osspd)
Expand Down
9 changes: 5 additions & 4 deletions osspd.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is released under the GPLv2.
*/

#define FUSE_USE_VERSION 28
#define FUSE_USE_VERSION 35
#define _GNU_SOURCE

#include <assert.h>
Expand Down Expand Up @@ -2226,16 +2226,17 @@ static struct fuse_session *setup_ossp_cuse(const struct cuse_lowlevel_ops *ops,
.flags = CUSE_UNRESTRICTED_IOCTL };
struct fuse_session *se;
int fd;
int multithreaded;

snprintf(name_buf, sizeof(name_buf), "DEVNAME=%s", name);

se = cuse_lowlevel_setup(argc, argv, &ci, ops, NULL, NULL);
se = cuse_lowlevel_setup(argc, argv, &ci, ops, &multithreaded, NULL);
if (!se) {
err("failed to setup %s CUSE", name);
return NULL;
}

fd = fuse_chan_fd(fuse_session_next_chan(se, NULL));
fd = fuse_session_fd(se);
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
err_e(-errno, "failed to set CLOEXEC on %s CUSE fd", name);
cuse_lowlevel_teardown(se);
Expand All @@ -2250,7 +2251,7 @@ static void *cuse_worker(void *arg)
struct fuse_session *se = arg;
int rc;

rc = fuse_session_loop_mt(se);
rc = fuse_session_loop_mt(se, NULL);
cuse_lowlevel_teardown(se);

return (void *)(unsigned long)rc;
Expand Down

0 comments on commit 05d8179

Please sign in to comment.