Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to libfuse3 #14

Merged
merged 1 commit into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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