socket-util: Correctly return negative values for errors.
authorBen Pfaff <blp@nicira.com>
Tue, 6 Dec 2011 23:55:22 +0000 (15:55 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 7 Dec 2011 16:37:36 +0000 (08:37 -0800)
commitaebe8d21d8af1487a18f30b7a172dff9bb5d649e
tree0155d7697dc7ecc90fc9c88b9db4f69118236a8b
parentce3408f32fbde696ef05e1724d3552f6b2276e57
socket-util: Correctly return negative values for errors.

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.

It really seems to me that this should have been found pretty quickly in
the field, since stream-tcp and stream-ssl both use inet_open_passive to
implement their passive listeners.  I'm surprised that no one has reported
it.
lib/socket-util.c