Fixed socket() error handling when cmdbuf[2] is actually an error-code, not a handle. In socket(), write SYNC_ERROR to errno when an error occurs due to cmdbuf[1].
This commit is contained in:
parent
585f84276a
commit
8e620c269d
@ -41,9 +41,11 @@ int socket(int domain, int type, int protocol)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = (int)cmdbuf[1];
|
ret = (int)cmdbuf[1];
|
||||||
if(ret != 0) {
|
if(ret == 0)ret = cmdbuf[2];
|
||||||
|
if(ret < 0) {
|
||||||
__release_handle(fd);
|
__release_handle(fd);
|
||||||
errno = _net_convert_error(cmdbuf[2]);
|
if(cmdbuf[1] == 0)errno = _net_convert_error(ret);
|
||||||
|
if(cmdbuf[1] != 0)errno = SYNC_ERROR;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user