return ff_neterrno();
if (s->listen) {
- fd = ff_listen_bind(fd, (struct sockaddr *)&s->addr,
- sizeof(s->addr), s->timeout, h);
- if (fd < 0) {
- ret = fd;
+ ret = ff_listen_bind(fd, (struct sockaddr *)&s->addr,
+ sizeof(s->addr), s->timeout, h);
+ if (ret < 0)
goto fail;
- }
+ fd = ret;
} else {
ret = ff_listen_connect(fd, (struct sockaddr *)&s->addr,
sizeof(s->addr), s->timeout, h, 0);