Subject: Re: [libssh2] meaning of -37 "Failed getting banner" / "Unable to exchange encryption keys" /

Re: [libssh2] meaning of -37 "Failed getting banner" / "Unable to exchange encryption keys" /

From: TJ Saunders <tj_at_castaglia.org>
Date: Thu, 26 Apr 2012 13:03:52 -0700 (PDT)

> strangely, there isn't, but instead a return code of -1 means poll()
> throwing an error – namely "Interrupted system call" (errno=4).

This can happen if, for example, some other portion of your code uses
alarm(3) (or something similar), i.e. some other signal was received by
your process which interrupted the poll(2) call. So to progress on your
task, maybe you can install signal handlers for the various signals; each
signal handler could set a bit in some bitset indicating which signal was
received. Thus any time you get an errno of EINTR, you can check that
bitset to see which signal interrupted your system call.

Hope this helps,
TJ

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   The reasonable man adapts himself to the world: the unreasonable
   man persists in trying to adapt the world to himself. Therefore
   all progress depends on the unreasonable man.

           -George Bernard Shaw

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-04-26