"man connect" says:

RETURN VALUE
       If  the connection or binding succeeds, zero is returned.  On error, -1
       is returned, and errno is set appropriately.

Can you make sure this is properly respected for normal socket connections still?