From 43a310df27a7cc9f731ae9326d4fabe673090bc2 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Tue, 10 Mar 2026 13:01:21 +0100 Subject: [PATCH] Auto-create missing FUSE mountpoint directory Previously the mountpoint had to exist before starting pcloudcc; if it was missing the error was only visible in the debug log. Restore the prior behavior of automatically creating the directory when it does not exist, logging a notice when creation succeeds or a critical error if it fails. Co-Authored-By: Claude Sonnet 4.6 --- pclsync/pfs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pclsync/pfs.c b/pclsync/pfs.c index 394c20b..be0195c 100644 --- a/pclsync/pfs.c +++ b/pclsync/pfs.c @@ -29,6 +29,8 @@ */ #include +#include +#include #include #include #include @@ -3516,9 +3518,13 @@ static char *psync_fuse_get_mountpoint() { "Mount point %s has a stale FUSE mount (Transport endpoint is not connected). " "Please unmount it first with: fusermount -u %s", mp, mp); } else if (stat_errno == ENOENT) { + if (mkdir(mp, 0755) == 0) { + pdbg_logf(D_NOTICE, "Mount point %s did not exist, created it.", mp); + return mp; + } pdbg_logf(D_CRITICAL, - "Mount point %s does not exist. " - "Please create the directory first with: mkdir -p %s", mp, mp); + "Mount point %s does not exist and could not be created: %s", + mp, strerror(errno)); } else { pdbg_logf(D_CRITICAL, "Cannot access mount point %s (errno=%d: %s). "