From a175c2876ac65235affaa07d81ecd904034734a1 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Wed, 22 Jun 2016 17:02:30 -0700 Subject: port sshfs to cygwin --- configure.ac | 1 + sshfs.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index 7c0cdd1..7fa6969 100644 --- a/configure.ac +++ b/configure.ac @@ -49,6 +49,7 @@ have_fuse_opt_parse=no oldlibs="$LIBS" LIBS="$LIBS $SSHFS_LIBS" AC_CHECK_FUNC([fuse_opt_parse], [have_fuse_opt_parse=yes]) +AC_CHECK_FUNC([fsp_fuse_opt_parse], [have_fuse_opt_parse=yes]) LIBS="$oldlibs" if test "$have_fuse_opt_parse" = no -o "$osname" = darwin; then CFLAGS="$CFLAGS -I${srcdir}/compat" diff --git a/sshfs.c b/sshfs.c index f41d987..3186867 100644 --- a/sshfs.c +++ b/sshfs.c @@ -11,7 +11,9 @@ #include #include +#if !defined(__CYGWIN__) #include +#endif #ifdef __APPLE__ # include #endif @@ -4108,7 +4110,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); @@ -4120,20 +4124,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, -- cgit v1.2.3 From efeed712953258f5466b0821d8e30ab98979299c Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Thu, 12 Jan 2017 11:24:08 -0800 Subject: remove no longer useful check for fsp_fuse_opt_parse from configure.ac --- configure.ac | 1 - 1 file changed, 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7fa6969..7c0cdd1 100644 --- a/configure.ac +++ b/configure.ac @@ -49,7 +49,6 @@ have_fuse_opt_parse=no oldlibs="$LIBS" LIBS="$LIBS $SSHFS_LIBS" AC_CHECK_FUNC([fuse_opt_parse], [have_fuse_opt_parse=yes]) -AC_CHECK_FUNC([fsp_fuse_opt_parse], [have_fuse_opt_parse=yes]) LIBS="$oldlibs" if test "$have_fuse_opt_parse" = no -o "$osname" = darwin; then CFLAGS="$CFLAGS -I${srcdir}/compat" -- cgit v1.2.3