Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Wrong return value of _modbus_tcp_pi_connect() on failure #61

Closed
oldfaber opened this Issue · 1 comment

2 participants

@oldfaber

If getaddrinfo() fails inside _modbus_tcp_pi_connect() "rc" is returned at line 305.
This is not consistent with _modbus_tcp_connect that always return -1, and with the
documentation of modbus_connect().
"return rc" should be "return (-1)".

Moreover errno is not set, but this is a bigger issue, as errno is not set for
many errors.

Regards

Fabio

@stephane stephane closed this in 2dca042
@stephane
Owner

Fabio,

Thank you for the report, the problem has been fixed.

errno is set explicitely by libmodbus or by the system call on Unix/Linux systems, I know the situation isn't as good on Windows. Feel free to indicate the missing errno you've catched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.