Subject: Re: libssh2 master 1b3b7b2... Add test to check if the socket is connected.

Re: libssh2 master 1b3b7b2... Add test to check if the socket is connected.

From: Daiki Ueno <ueno_at_unixuser.org>
Date: Wed, 06 Jan 2010 13:11:53 +0900

Daniel Stenberg <daniel_at_haxx.se> writes:

>> BTW, related to portability (but a trifling issue), I would propose
>> eliminating "negative exit codes" in example/*.c.
>
> I just browsed through a few just now, but don't most of them return 0
> from main() ?

No, actually all the examples except ssh2_agent.c may return -1 on
failure. For example:

    if (connect(sock, (struct sockaddr*)(&sin),
                sizeof(struct sockaddr_in)) != 0) {
        fprintf(stderr, "failed to connect!\n");
        return -1;
    }

in main() of ssh2.c.

Regards,

-- 
Daiki Ueno
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-01-06