diff options
author | Vassili Tchersky <vt+git@vbcy.org> | 2025-02-17 08:54:45 +0100 |
---|---|---|
committer | Bernd Schubert <bernd@bsbernd.com> | 2025-02-18 22:32:49 +0100 |
commit | 4c562bf25d4aa01d364a8c30f1315705f932ec72 (patch) | |
tree | a8ea3f4ea6908537bd730c9a6a6829480a093418 | |
parent | 8af70b496cac0f69a4b2835bc5388a8e327725a8 (diff) | |
download | libfuse-4c562bf25d4aa01d364a8c30f1315705f932ec72.tar.gz |
mount_bsd: Show errors when syscalls failed
Log on unmount() and close() failure
Signed-off-by: Vassili Tchersky <vt+git@vbcy.org>
-rw-r--r-- | lib/mount_bsd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/mount_bsd.c b/lib/mount_bsd.c index ba17240..0e841df 100644 --- a/lib/mount_bsd.c +++ b/lib/mount_bsd.c @@ -128,8 +128,11 @@ static int fuse_mount_opt_proc(void *data, const char *arg, int key, void fuse_kern_unmount(const char *mountpoint, int fd) { - close(fd); - unmount(mountpoint, MNT_FORCE); + if (close(fd) < 0) + fuse_log(FUSE_LOG_ERR, "closing FD %d failed: %s", fd, strerror(errno)); + if (unmount(mountpoint, MNT_FORCE) < 0) + fuse_log(FUSE_LOG_ERR, "unmounting %s failed: %s", + mountpoint, strerror(errno)); } static int fuse_mount_core(const char *mountpoint, const char *opts) @@ -220,7 +223,8 @@ mount: if (waitpid(cpid, &status, 0) == -1 || WEXITSTATUS(status) != 0) { perror("fuse: failed to mount file system"); - close(fd); + if (close(fd) < 0) + perror("fuse: closing FD"); return -1; } |