From c7c5dbe7cfa5c956ecb36ed69e13eae62a8f4966 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Fri, 22 Aug 2025 18:12:07 +0200 Subject: Fix passthrough_hp.cc indentation Commit f8fe398ee14864e2c3c7c524ca851d7cc08bed28 introduced an invalid passthrough_hp.cc indentation and that was not detected by checkpatch, as that only handles C files. Signed-off-by: Bernd Schubert --- example/passthrough_hp.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/example/passthrough_hp.cc b/example/passthrough_hp.cc index 2bdfc0a..1a67704 100644 --- a/example/passthrough_hp.cc +++ b/example/passthrough_hp.cc @@ -254,19 +254,19 @@ static void sfs_getattr(fuse_req_t req, fuse_ino_t ino, fuse_file_info *fi) fuse_reply_attr(req, &attr, fs.timeout); } -static int with_fd_path(int fd, const std::function& f) +static int with_fd_path(int fd, const std::function &f) { #ifdef __FreeBSD__ - struct kinfo_file kf; - kf.kf_structsize = sizeof(kf); - int ret = fcntl(fd, F_KINFO, &kf); - if (ret == -1) - return ret; - return f (kf.kf_path); + struct kinfo_file kf; + kf.kf_structsize = sizeof(kf); + int ret = fcntl(fd, F_KINFO, &kf); + if (ret == -1) + return ret; + return f(kf.kf_path); #else // Linux - char procname[64]; - sprintf(procname, "/proc/self/fd/%i", fd); - return f(procname); + char procname[64]; + sprintf(procname, "/proc/self/fd/%i", fd); + return f(procname); #endif } static void do_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr, @@ -280,7 +280,7 @@ static void do_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr, if (fi) { res = fchmod(fi->fh, attr->st_mode); } else { - res = with_fd_path(ifd, [attr](const char* procname) { + res = with_fd_path(ifd, [attr](const char *procname) { return chmod(procname, attr->st_mode); }); } @@ -304,7 +304,7 @@ static void do_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr, if (fi) { res = ftruncate(fi->fh, attr->st_size); } else { - res = with_fd_path(ifd, [attr](const char* procname) { + res = with_fd_path(ifd, [attr](const char *procname) { return truncate(procname, attr->st_size); }); } @@ -333,7 +333,7 @@ static void do_setattr(fuse_req_t req, fuse_ino_t ino, struct stat *attr, res = futimens(fi->fh, tv); else { #ifdef HAVE_UTIMENSAT - res = with_fd_path(ifd, [&tv](const char* procname) { + res = with_fd_path(ifd, [&tv](const char *procname) { return utimensat(AT_FDCWD, procname, tv, 0); }); #else @@ -1089,7 +1089,7 @@ static void sfs_open(fuse_req_t req, fuse_ino_t ino, fuse_file_info *fi) /* Unfortunately we cannot use inode.fd, because this was opened with O_PATH (so it doesn't allow read/write access). */ - auto fd = with_fd_path(inode.fd, [fi](const char* buf) { + auto fd = with_fd_path(inode.fd, [fi](const char *buf) { return open(buf, fi->flags & ~O_NOFOLLOW); }); if (fd == -1) { -- cgit v1.2.3