Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758019AbYCaVIb (ORCPT ); Mon, 31 Mar 2008 17:08:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755313AbYCaVIX (ORCPT ); Mon, 31 Mar 2008 17:08:23 -0400 Received: from x346.tv-sign.ru ([89.108.83.215]:57122 "EHLO mail.screens.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755143AbYCaVIX (ORCPT ); Mon, 31 Mar 2008 17:08:23 -0400 Date: Tue, 1 Apr 2008 00:07:58 +0400 From: Oleg Nesterov To: Roland McGrath Cc: Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] do_wait reorganization Message-ID: <20080331200758.GA115@tv-sign.ru> References: <20080329033412.120EE26FA1D@magilla.localdomain> <20080331035701.3926726F8E9@magilla.localdomain> <20080331085110.GA400@tv-sign.ru> <20080331202910.5C4C926F8E9@magilla.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080331202910.5C4C926F8E9@magilla.localdomain> User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1202 Lines: 42 On 03/31, Roland McGrath wrote: > > I think it should look like this: > > { > int ret = eligible_child(type, pid, options, p); > if (ret <= 0) > return ret; > > if (p->exit_state == EXIT_DEAD) > return 0; > > /* > * We don't reap group leaders with subthreads. > */ > if (p->exit_state == EXIT_ZOMBIE && !delay_group_leader(p)) > return wait_task_zombie(p, options, infop, stat_addr, ru); > > /* > * It's stopped or running now, so it might > * later continue, exit, or stop again. > */ > *retval = 0; > > if (task_is_stopped_or_traced(p)) > return wait_task_stopped(p, options, infop, stat_addr, ru); > > return wait_task_continued(p, options, infop, stat_addr, ru); > } I think you are right. (BTW, you moved the "options & WHATEVER" checks into wait_task_xxx(), I think this really makes the code more readable and maintainable). Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/