[MPlayer-cvslog] r33578 - trunk/mplayer.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Jun 11 17:01:25 CEST 2011


On Sat, Jun 11, 2011 at 03:27:35PM +0200, cboesch wrote:
> Author: cboesch
> Date: Sat Jun 11 15:27:29 2011
> New Revision: 33578
> 
> Log:
> Clarify child_sighandler loop.
> 
> Modified:
>    trunk/mplayer.c
> 
> Modified: trunk/mplayer.c
> ==============================================================================
> --- trunk/mplayer.c	Fri Jun 10 14:52:23 2011	(r33577)
> +++ trunk/mplayer.c	Sat Jun 11 15:27:29 2011	(r33578)
> @@ -792,7 +792,9 @@ void exit_player(enum exit_reason how)
>  static void child_sighandler(int x)
>  {
>      pid_t pid;
> -    while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) ;
> +    do {
> +        pid = waitpid(-1, NULL, WNOHANG);
> +    } while (pid > 0);

I'd consider
while (waitpid(-1, NULL, WNOHANG) > 0) /* */;
simpler.
Though for clarity a comment would probably help most, e.g.:
// reap all children but do not wait


More information about the MPlayer-cvslog mailing list