Re: [PATCH] Wait on all pids, not just udevd's. (#540923)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Note that this is to make it match the patch I sent earlier for rhel6-branch.

On 04/12/2010 01:09 PM, Peter Jones wrote:
> If we wait only on udevd's pid, it means we've got zombie processes
> hanging out.  So instead, wait on all pids, and then only do the udevd
> stuff if we actually see udevd exit.
> ---
>  loader/init.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/loader/init.c b/loader/init.c
> index a2095de..1a38df3 100644
> --- a/loader/init.c
> +++ b/loader/init.c
> @@ -503,7 +503,7 @@ int main(int argc, char **argv) {
>          pid_t retpid;
>          int waitstatus;
>  
> -        retpid = waitpid(childpid, &waitstatus, 0);
> +        retpid = wait(&waitstatus);
>          if (retpid == -1) {
>              if (errno == EINTR)
>                  continue;
> @@ -514,7 +514,7 @@ int main(int argc, char **argv) {
>                  break;
>              printf("init: error waiting on udevd: %m\n");
>              exit(1);
> -        } else if (WIFEXITED(waitstatus)) {
> +        } else if ((retpid == childpid) && WIFEXITED(waitstatus)) {
>              break;
>          }
>      } while (1);
> @@ -768,7 +768,7 @@ int main(int argc, char **argv) {
>      
>      while (!doShutdown) {
>          pid_t childpid;
> -        childpid = waitpid(-1, &waitStatus, 0);
> +        childpid = wait(&waitStatus);
>  
>          if (childpid == installpid) {
>              doShutdown = 1;


-- 
        Peter

All parts should go together without forcing. You must remember that
the parts you are  reassembling were disassembled by you.  Therefore,
if you can't get them together again, there must be a reason. By all
means, do not use a hammer.
		-- IBM maintenance manual, 1925

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux