Skip to content

Commit

Permalink
network: errno should be already negative
Browse files Browse the repository at this point in the history
Don't make errno positive by accidently flipping the sign

This turns iio_strerror() from this:
   Unable to create IIO context Unknown error -110 (110)
into:
   Unable to create IIO context Connection timed out (-110)

Signed-off-by: Robin Getz <[email protected]>
  • Loading branch information
rgetz committed Feb 19, 2020
1 parent 5f5af2e commit bb99e5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion network.c
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ struct iio_context * network_create_context(const char *host)

fd = create_socket(res, DEFAULT_TIMEOUT_MS);
if (fd < 0) {
errno = -fd;
errno = fd;
goto err_free_addrinfo;
}

Expand Down

0 comments on commit bb99e5f

Please sign in to comment.