aboutsummaryrefslogtreecommitdiff
path: root/sshfs.c
diff options
context:
space:
mode:
authorNikolaus Rath <Nikolaus@rath.org>2017-01-12 14:57:45 -0800
committerGitHub <noreply@github.com>2017-01-12 14:57:45 -0800
commitf627055bc754cfbee6651201ba1aa100d18e7683 (patch)
tree143fc7fabe152708ee1d3741073ba29620074938 /sshfs.c
parent96c61389785d422196932565cfe38b6a33912ee9 (diff)
parentefeed712953258f5466b0821d8e30ab98979299c (diff)
downloadsshfs-f627055bc754cfbee6651201ba1aa100d18e7683.tar
sshfs-f627055bc754cfbee6651201ba1aa100d18e7683.tar.gz
sshfs-f627055bc754cfbee6651201ba1aa100d18e7683.tar.bz2
sshfs-f627055bc754cfbee6651201ba1aa100d18e7683.zip
Merge pull request #23 from billziss-gh/master
Port SSHFS to Cygwin
Diffstat (limited to 'sshfs.c')
-rw-r--r--sshfs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sshfs.c b/sshfs.c
index 77f3dbf..8cde971 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -11,7 +11,9 @@
#include <fuse.h>
#include <fuse_opt.h>
+#if !defined(__CYGWIN__)
#include <fuse_lowlevel.h>
+#endif
#ifdef __APPLE__
# include <fuse_darwin.h>
#endif
@@ -4113,7 +4115,9 @@ int main(int argc, char *argv[])
char *mountpoint;
int multithreaded;
int foreground;
+#if !defined(__CYGWIN__)
struct stat st;
+#endif
res = fuse_parse_cmdline(&args, &mountpoint, &multithreaded,
&foreground);
@@ -4125,20 +4129,26 @@ int main(int argc, char *argv[])
foreground = 1;
}
+#if !defined(__CYGWIN__)
res = stat(mountpoint, &st);
if (res == -1) {
perror(mountpoint);
exit(1);
}
sshfs.mnt_mode = st.st_mode;
+#elif defined(__CYGWIN__)
+ sshfs.mnt_mode = S_IFDIR | 0755;
+#endif
ch = fuse_mount(mountpoint, &args);
if (!ch)
exit(1);
+#if !defined(__CYGWIN__)
res = fcntl(fuse_chan_fd(ch), F_SETFD, FD_CLOEXEC);
if (res == -1)
perror("WARNING: failed to set FD_CLOEXEC on fuse device");
+#endif
sshfs.op = cache_init(&sshfs_oper);
fuse = fuse_new(ch, &args, sshfs.op,