mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 02:38:31 +00:00
Fix ECHILD with WNOHANG on Windows
This change along with a patch for rsync's safe_write() function that'll that'll soon be added to superconfigure, gets rsync working. There's one remaining issue (which isn't a blocker) which is how rsync logs an error about abnormal process termination since there's currently no way for us to send non-fatal signals between processes. rsync in cosmos is restored Fixes #1240
This commit is contained in:
parent
8313dca982
commit
8527462b95
2 changed files with 79 additions and 7 deletions
|
@ -88,18 +88,20 @@ static textwindows int __proc_wait(int pid, int *wstatus, int options,
|
|||
__proc_lock();
|
||||
CheckForZombies:
|
||||
int rc = __proc_check(pid, wstatus, rusage);
|
||||
|
||||
// if there's no zombies left
|
||||
// check if there's any living processes
|
||||
if (!rc && dll_is_empty(__proc.list)) {
|
||||
__proc_unlock();
|
||||
return echild();
|
||||
}
|
||||
|
||||
// otherwise return zombie or zero
|
||||
if (rc || (options & WNOHANG)) {
|
||||
__proc_unlock();
|
||||
return rc;
|
||||
}
|
||||
|
||||
// there's no zombies left
|
||||
// check if there's any living processes
|
||||
if (dll_is_empty(__proc.list)) {
|
||||
__proc_unlock();
|
||||
return echild();
|
||||
}
|
||||
|
||||
// get appropriate wait object
|
||||
// register ourself as waiting
|
||||
struct Proc *pr = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue