[ovs-dev] [PATCH] socket-util: Correctly return negative values for errors.

Brian Haley brian.haley at hp.com
Wed Dec 7 14:19:41 UTC 2011


On 12/06/2011 06:55 PM, Ben Pfaff wrote:
> The comment on this function says that negative values indicate errors, and
> the callers assume that too, but in fact it was returning positive errno
> values, which are indistinguishable from valid fd numbers.

> @@ -716,6 +716,7 @@ inet_open_passive(int style, const char *target, int default_port,
>              goto error;
>          }
>          if (sin.sin_family != AF_INET || sin_len != sizeof sin) {
> +            error = EAFNOSUPPORT;

-EAFNOSUPPORT, right?

-Brian



More information about the dev mailing list