Only pick up so_error the first time through with EISCONN, as advertised.

The sense of the test was reversed, so we were returning EISCONN, then 0.

Pointed out and tested by: Martin Blapp <mb@imp.ch>
This commit is contained in:
jlemon 2001-03-02 19:29:53 +00:00
parent 3e8d7346e8
commit 0e6ea63318

View File

@ -423,7 +423,7 @@ linux_connect(struct proc *p, struct linux_connect_args *args)
error = EISCONN;
if (fp->f_flag & FNONBLOCK) {
so = (struct socket *)fp->f_data;
if ((u_int)so->so_emuldata != 0)
if ((u_int)so->so_emuldata == 0)
error = so->so_error;
so->so_emuldata = (void *)1;
}