Apply some touchups

This commit is contained in:
Justine Tunney 2021-02-07 06:11:44 -08:00
parent 9f149e1de3
commit 2f3bd90216
139 changed files with 1188 additions and 1154 deletions

View file

@ -28,14 +28,22 @@
* @asyncsignalsafe
*/
int fork(void) {
int rc;
axdx_t ad;
int ax, dx;
if (!IsWindows()) {
rc = sys_fork();
ad = sys_fork();
ax = ad.ax;
dx = ad.dx;
if (IsXnu() && ax != -1) {
/* eax always returned with childs pid */
/* edx is 0 for parent and 1 for child */
ax &= dx - 1;
}
} else {
rc = sys_fork_nt();
ax = sys_fork_nt();
}
if (rc == 0) {
if (!ax) {
__onfork();
}
return rc;
return ax;
}