Subject: [libssh2] EINTR treatment at session.c/ _libssh2_wait_socket()

[libssh2] EINTR treatment at session.c/ _libssh2_wait_socket()

From: Nick Rudnick <>
Date: Mon, 30 Apr 2012 11:31:00 +0200

Dear all,

thanks to your help I was able to find a workaround for my problem, being
in relation to Haskell and maybe other languages emitting signals that may
interfere libssh2 processing (info thanks to Edward Z. Yang):

This problem seems to be solved by a very small modification (diff file is

< session->err_code = LIBSSH2_ERROR_TIMEOUT;

>     if(errno != EINTR){
>             session->err_code = LIBSSH2_ERROR_TIMEOUT;
>             return LIBSSH2_ERROR_TIMEOUT;
>     }
Pondering the operational semantics of  _libssh2_wait_socket() now, with
the impression that an EINTR usually would be regarded as a transient
incident, I am asking myself in how far not aborting at EINTR might violate
the intended behavior in any way.
If there were no objections, an introduction to the code base would be
great  especially on Windows, where a necessity to compile often means a
considerable amount of effort.
Thanks a lot for your support, Nick


Received on 2012-04-30