Subject: Re: core dump when calling libssh2_session_disconnect when sftp server timeout

Re: core dump when calling libssh2_session_disconnect when sftp server timeout

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Fri, 16 Dec 2011 17:42:31 +0100

fre 2011-12-16 klockan 22:04 +0800 skrev Ahmad Zaidee Abu:

> The application works well with cc: HP C/aC++ B3910B A.06.20 but core
> dump due to SIGPIPE error when compiled with another machine with cc:
> HP C/aC++ B3910B A.06.25.

SIGPIPE is a generic UNIX signal, received when an application tries to
write to a no longer existing pipe/socket connection.

To avoid this crashing your application, set the signal as ignored.

#include <signal.h>

[...]

  signal(SIGPIPE, SIG_IGN);

Regards
Henrik

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-12-16