~ubuntu-branches/ubuntu/quantal/libssh/quantal

« back to all changes in this revision

Viewing changes to debian/patches/0001-socket.c-Fixed-setting-max_fd-which-breaks-ssh_selec.patch

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2011-03-13 22:06:00 UTC
  • mfrom: (1.1.9 upstream) (4.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110313220600-bbqbkcj8zelnfbbo
Tags: 0.4.8-2
* Upload to unstable
* debian/control: Add texlive-fonts-recommended to Build-Depends-Indep
  (Closes: #608319)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Vic Lee <llyzs@163.com>
2
 
Date: Mon, 20 Sep 2010 16:32:08 +0000
3
 
Subject: [PATCH] socket.c: Fixed setting max_fd which breaks ssh_select().
4
 
 
5
 
Signed-off-by: Andreas Schneider <asn@cynapses.org>
6
 
---
7
 
 libssh/socket.c |    5 ++++-
8
 
 1 files changed, 4 insertions(+), 1 deletions(-)
9
 
 
10
 
diff --git a/libssh/socket.c b/libssh/socket.c
11
 
index 402a5b7..02db660 100644
12
 
--- a/libssh/socket.c
13
 
+++ b/libssh/socket.c
14
 
@@ -257,7 +257,10 @@ void ssh_socket_fd_set(struct socket *s, fd_set *set, socket_t *max_fd) {
15
 
   if (s->fd == SSH_INVALID_SOCKET)
16
 
     return;
17
 
   FD_SET(s->fd,set);
18
 
-  if (s->fd >= 0 && s->fd != SSH_INVALID_SOCKET) {
19
 
+
20
 
+  if (s->fd >= 0 &&
21
 
+      s->fd >= *max_fd &&
22
 
+      s->fd != SSH_INVALID_SOCKET) {
23
 
     *max_fd = s->fd + 1;
24
 
   }
25
 
 }