aboutsummaryrefslogtreecommitdiff
path: root/libssh/sftp.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-09-21 12:23:15 +0200
committerAndreas Schneider <mail@cynapses.org>2009-09-21 12:23:47 +0200
commit4133f484ae317909169ad8e1bc689d25cabd9a77 (patch)
treec179f9e1abd377d915de896c2befe9db860c0615 /libssh/sftp.c
parent041aff8060ace97ddab83037acdd228727ab9220 (diff)
downloadlibssh-4133f484ae317909169ad8e1bc689d25cabd9a77.tar.gz
libssh-4133f484ae317909169ad8e1bc689d25cabd9a77.tar.xz
libssh-4133f484ae317909169ad8e1bc689d25cabd9a77.zip
Fixed building libssh with MSVC.
Thanks to Carlo Segato for the patch.
Diffstat (limited to 'libssh/sftp.c')
-rw-r--r--libssh/sftp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/libssh/sftp.c b/libssh/sftp.c
index 5265eb5a..49eb565c 100644
--- a/libssh/sftp.c
+++ b/libssh/sftp.c
@@ -33,6 +33,14 @@
#ifndef _WIN32
#include <arpa/inet.h>
+#else
+#define S_IFSOCK 0140000
+#define S_IFLNK 0120000
+
+#ifdef _MSC_VER
+#define S_IFBLK 0060000
+#define S_IFIFO 0010000
+#endif
#endif
#include "libssh/priv.h"
@@ -933,7 +941,6 @@ static SFTP_ATTRIBUTES *sftp_parse_attr_4(SFTP_SESSION *sftp, ssh_buffer buf,
}
attr->permissions = ntohl(attr->permissions);
-#ifndef _WIN32
/* FIXME on windows! */
switch (attr->permissions & S_IFMT) {
case S_IFSOCK:
@@ -955,7 +962,6 @@ static SFTP_ATTRIBUTES *sftp_parse_attr_4(SFTP_SESSION *sftp, ssh_buffer buf,
attr->type = SSH_FILEXFER_TYPE_UNKNOWN;
break;
}
-#endif /* _WIN32 */
}
if (flags & SSH_FILEXFER_ATTR_ACCESSTIME) {
@@ -1126,8 +1132,6 @@ static SFTP_ATTRIBUTES *sftp_parse_attr_3(SFTP_SESSION *sftp, ssh_buffer buf,
}
attr->permissions = ntohl(attr->permissions);
-#ifndef _WIN32
- /* FIXME on windows */
switch (attr->permissions & S_IFMT) {
case S_IFSOCK:
case S_IFBLK:
@@ -1148,7 +1152,6 @@ static SFTP_ATTRIBUTES *sftp_parse_attr_3(SFTP_SESSION *sftp, ssh_buffer buf,
attr->type = SSH_FILEXFER_TYPE_UNKNOWN;
break;
}
-#endif /* _WIN32 */
}
if (flags & SSH_FILEXFER_ATTR_ACMODTIME) {