summaryrefslogtreecommitdiffstats
path: root/libssh/channels.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-08-16 13:35:21 +0200
committerAndreas Schneider <mail@cynapses.org>2009-08-16 14:40:18 +0200
commit756d441f8c55d97396d7575188a1f48e4827ff58 (patch)
treebdc326991edc1e81bfde8c2f333aaa96eddb3df5 /libssh/channels.c
parentdb6aa88bc4edcfb14663140db1ee25f5b2a47952 (diff)
downloadlibssh-756d441f8c55d97396d7575188a1f48e4827ff58.tar.gz
libssh-756d441f8c55d97396d7575188a1f48e4827ff58.tar.xz
libssh-756d441f8c55d97396d7575188a1f48e4827ff58.zip
Fix channel_accept_x11 on Windows.
Diffstat (limited to 'libssh/channels.c')
-rw-r--r--libssh/channels.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libssh/channels.c b/libssh/channels.c
index cc9f872e..c536842b 100644
--- a/libssh/channels.c
+++ b/libssh/channels.c
@@ -1335,9 +1335,14 @@ error:
return rc;
}
+static ssh_channel channel_accept(ssh_session session, int channeltype,
+ int timeout_ms) {
#ifndef _WIN32
-static ssh_channel channel_accept(ssh_session session, int channeltype, int timeout_ms) {
- static const struct timespec ts = {0, 50000000}; /* 50ms */
+ static const struct timespec ts = {
+ .tv_sec = 0,
+ .tv_nsec = 50000000 /* 50ms */
+ };
+#endif
SSH_MESSAGE *msg = NULL;
struct ssh_iterator *iterator;
int t;
@@ -1358,7 +1363,11 @@ static ssh_channel channel_accept(ssh_session session, int channeltype, int time
iterator = iterator->next;
}
}
+#ifdef _WIN32
+ Sleep(50); /* 50ms */
+#else
nanosleep(&ts, NULL);
+#endif
}
return NULL;
@@ -1376,7 +1385,6 @@ static ssh_channel channel_accept(ssh_session session, int channeltype, int time
ssh_channel channel_accept_x11(ssh_channel channel, int timeout_ms) {
return channel_accept(channel->session, SSH_CHANNEL_X11, timeout_ms);
}
-#endif
static int global_request(ssh_session session, const char *request,
ssh_buffer buffer, int reply) {