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 18:11:00 +0100 |
commit | 06fef4f8c3873e43027b8221a745a5fdf63d867c (patch) | |
tree | 98a5aac4f4ea88e6cc9ff5f23f76d05cfcf944a7 | |
parent | f665917e93509183eb798a1c9862f6cb851b7530 (diff) | |
download | libfuse-06fef4f8c3873e43027b8221a745a5fdf63d867c.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; } |