From patchwork Wed Feb 19 10:30:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denys Vlasenko X-Patchwork-Id: 11391209 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E86E92A for ; Wed, 19 Feb 2020 10:30:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FB5720801 for ; Wed, 19 Feb 2020 10:30:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Tj1zkU+1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726487AbgBSKaS (ORCPT ); Wed, 19 Feb 2020 05:30:18 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:45945 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726270AbgBSKaS (ORCPT ); Wed, 19 Feb 2020 05:30:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582108217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=2i8mSoRk4ZHOoz5pp5xySaHHUaYUF07DK7KBJspX0Vw=; b=Tj1zkU+1Slt96USgz2n0DVtLt397VXjqVsrjbCw+lMOAObPPWlYANdyz394iP+GqZ42kcg HKuAjMajup0mch6uz0gZbXTTghBDZ6RPQ/2GyW5Ebr6cfzp0bqSAIax5No+3ciH6MhSTy+ /2uplAfQix1yCsxYGSIotZHPi6lpkZE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-311-5c1T13BbNXGcfLwjX5V3oA-1; Wed, 19 Feb 2020 05:30:13 -0500 X-MC-Unique: 5c1T13BbNXGcfLwjX5V3oA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2367107ACCA; Wed, 19 Feb 2020 10:30:12 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.17.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 139F848; Wed, 19 Feb 2020 10:30:11 +0000 (UTC) From: Denys Vlasenko To: Herbert Xu , dash@vger.kernel.org Cc: Denys Vlasenko Subject: [PATCH] Rename DOWAIT_NORMAL to DOWAIT_NONBLOCK Date: Wed, 19 Feb 2020 11:30:08 +0100 Message-Id: <20200219103008.22230-1-dvlasenk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: dash-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org To make it clearer what it is doing: nonblocking wait() Signed-off-by: Denys Vlasenko --- src/jobs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/jobs.c b/src/jobs.c index 26a6248..d0cf708 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -77,7 +77,7 @@ #define CUR_STOPPED 0 /* mode flags for dowait */ -#define DOWAIT_NORMAL 0 +#define DOWAIT_NONBLOCK 0 #define DOWAIT_BLOCK 1 #define DOWAIT_WAITCMD 2 @@ -557,7 +557,7 @@ showjobs(struct output *out, int mode) TRACE(("showjobs(%x) called\n", mode)); /* If not even one one job changed, there is nothing to do */ - dowait(DOWAIT_NORMAL, NULL); + dowait(DOWAIT_NONBLOCK, NULL); for (jp = curjob; jp; jp = jp->prev_job) { if (!(mode & SHOW_CHANGED) || jp->changed) @@ -1013,7 +1013,7 @@ waitforjob(struct job *jp) int st; TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0)); - dowait(jp ? DOWAIT_BLOCK : DOWAIT_NORMAL, jp); + dowait(jp ? DOWAIT_BLOCK : DOWAIT_NONBLOCK, jp); if (!jp) return exitstatus; @@ -1123,7 +1123,7 @@ out: static int dowait(int block, struct job *jp) { - int pid = block == DOWAIT_NORMAL ? gotsigchld : 1; + int pid = block == DOWAIT_NONBLOCK ? gotsigchld : 1; while (jp ? jp->state == JOBRUNNING : pid > 0) { if (!jp)