diff options
author | Sanne Raymaekers <sraymaek@redhat.com> | 2018-10-25 18:38:32 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-10-25 18:49:29 +0200 |
commit | ced05eb6dbbd9a20f0b96a454203a8d158157123 (patch) | |
tree | 684ea99d98350a51ea1fae679b234802fc70c213 /src/poll.c | |
parent | b796924fea7e61a4a8813acce9e510f2359aee34 (diff) | |
download | libssh-ced05eb6dbbd9a20f0b96a454203a8d158157123.tar.gz libssh-ced05eb6dbbd9a20f0b96a454203a8d158157123.tar.xz libssh-ced05eb6dbbd9a20f0b96a454203a8d158157123.zip |
socket: Undouble socket fds
Signed-off-by: Sanne Raymaekers <sraymaek@redhat.com>
Diffstat (limited to 'src/poll.c')
-rw-r--r-- | src/poll.c | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -533,19 +533,17 @@ int ssh_poll_ctx_add(ssh_poll_ctx ctx, ssh_poll_handle p) { * * @return 0 on success, < 0 on error */ -int ssh_poll_ctx_add_socket (ssh_poll_ctx ctx, ssh_socket s) { - ssh_poll_handle p_in, p_out; - int ret; - p_in=ssh_socket_get_poll_handle_in(s); - if(p_in==NULL) - return -1; - ret = ssh_poll_ctx_add(ctx,p_in); - if(ret != 0) +int ssh_poll_ctx_add_socket (ssh_poll_ctx ctx, ssh_socket s) +{ + ssh_poll_handle p; + int ret; + + p = ssh_socket_get_poll_handle(s); + if (p == NULL) { + return -1; + } + ret = ssh_poll_ctx_add(ctx,p); return ret; - p_out=ssh_socket_get_poll_handle_out(s); - if(p_in != p_out) - ret = ssh_poll_ctx_add(ctx,p_out); - return ret; } |