if ((ret=__syscall(SYS_setpgid, 0, attr->__pgrp)))
goto fail;
- /* Use syscalls directly because pthread state because the
- * library functions attempt to do a multi-threaded synchronized
- * id-change, which would trash the parent's state. */
+ /* Use syscalls directly because the library functions attempt
+ * to do a multi-threaded synchronized id-change, which would
+ * trash the parent's state. */
if (attr->__flags & POSIX_SPAWN_RESETIDS)
if ((ret=__syscall(SYS_setgid, __syscall(SYS_getgid))) ||
(ret=__syscall(SYS_setuid, __syscall(SYS_getuid))) )
}
switch(op->cmd) {
case FDOP_CLOSE:
- if ((ret=__syscall(SYS_close, op->fd)))
- goto fail;
+ __syscall(SYS_close, op->fd);
break;
case FDOP_DUP2:
if ((ret=__sys_dup2(op->srcfd, op->fd))<0)
fail:
/* Since sizeof errno < PIPE_BUF, the write is atomic. */
ret = -ret;
- if (ret) while (write(p, &ret, sizeof ret) < 0);
+ if (ret) while (__syscall(SYS_write, p, &ret, sizeof ret) < 0);
_exit(127);
}