Received: by 10.223.176.5 with SMTP id f5csp1531439wra; Wed, 7 Feb 2018 22:23:33 -0800 (PST) X-Google-Smtp-Source: AH8x227i7SRBWGbC56oUU8Zo7XuOgRAB7nVJfgnFJcgEUSG/v3uhExsgo6LVhOcJ0yJjTqPNkikg X-Received: by 2002:a17:902:bd84:: with SMTP id q4-v6mr8587195pls.247.1518071013759; Wed, 07 Feb 2018 22:23:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518071013; cv=none; d=google.com; s=arc-20160816; b=pFCfYXX3r9fvZql0pGmdCO58scMPruIPE/vf3/OEJZB/jan+WjO6ScDcMpAE6dj78J X7+KA1iWt3QtZfkwYIjdGY/sLQnJaUNTvUSPyDSzT5VDodp9xqpuftjTF66bXQqSvgdV 0AlZon9K0Y0wfNgtBMWUzhrJCyyyDHqAsZTx5f5sKy+sFG6QJPYclnleiPxsLkQt5hbf nThVFE9I7u6W7Nl+qKcgGaf20IoHb5l/YwrjcCZUYeqflSCPsM1oKFjpae75D62nV5NF ZXjjqFrecx2PXIJd1SXFWDQRGywK28DcjlMncWze4Z4z40EswcCeT/xNezp44mOHPqx2 NK+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=JmP6MC3pYtda+RhtWZzsSuobQp9MAPRnEm190gkMmLk=; b=iiwXy5YlScjAjZFEYrLExZCwFQFyNF0QtCy3FNjMSSDuwhzQDaLOXoV2BulYbyMJBv I0pAnlAdiXNzxWmHoUNT35gaAcenpXEWQmHgD6NN3Ixgrrfi1WQhAmVo1+Z3i1Uzu/19 ua4TBpTIDHil3p18vGYd62X2x4eV8zagQeW+seiqUgcc5LVjILi8SWdfZxVNMKRABR2C bhb+pjyDXup78c/yWYwCL+bV91Tnq7f8StoZ9ieJrhtlKd2D46KinhgjHLd5QsTtD51B nkP4HIsq1sgM/qSHj0zHyW1qefRSxuUxWkHx7kZYd0J9S05Ab3bdtK/99VkJFbVtMDi9 3Pkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qVErcP5x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si2007211pgq.35.2018.02.07.22.23.20; Wed, 07 Feb 2018 22:23:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qVErcP5x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751756AbeBHGVw (ORCPT + 99 others); Thu, 8 Feb 2018 01:21:52 -0500 Received: from mail-vk0-f65.google.com ([209.85.213.65]:37463 "EHLO mail-vk0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751130AbeBHGVv (ORCPT ); Thu, 8 Feb 2018 01:21:51 -0500 Received: by mail-vk0-f65.google.com with SMTP id g83so2105469vki.4; Wed, 07 Feb 2018 22:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JmP6MC3pYtda+RhtWZzsSuobQp9MAPRnEm190gkMmLk=; b=qVErcP5xEpGtB2ivBwUP603MzDzOhQQ03+U3ZkEBOcP/xAZl/n/q014IFco1JfakHX TkQIuunuwLG4aiIG3lu7JEgx6LFUIKuZk663XId/CGyAmBE+S4rKSxBeBHfDoG8y1Jfk 8nd0jS+t0ygAhYvdgKIBHHk8jDKSMlCJMowk+YnuyinfOoEwTP1yIRhVmzxrpIdGUVyz Hu4iThUfEqShKgRdPfemG6t24+se8HXGAps6e9GimRvbUETjb9Fy0FtF+FRsdwvh4iRx QlBUyA92r9D2zelPO3arZHshLYB1cMp6MF3yERaJ9XEp8pI8NA79b8jknTpvxgwo6cUl G1BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JmP6MC3pYtda+RhtWZzsSuobQp9MAPRnEm190gkMmLk=; b=g+vkXBQqOB285L3ocAtmgznsBRN3KCojPdEfVcXt0h7ska1O4iChrZeyP1hboKfOb3 x70sU5p3GiE5wdPoLjgRU3lvBijSafa84l0K92V/XJnKaAE2OlvMPcmYPmKhHIqc5XNO 8UJcHi0jyGUjWKJlyIClr2bnKcj5YmXZjGhuo/+8R+d7HNA9RaW7mD2Tfb3Bi+4coJ+k hAAHsPRGNgtDb4hF+1Fv5YCAoK87YJ6Zwy9OsadgWLBXoLYYkivaAAKSRl+d0StfSdts YIDZ6lHeYCpq3DkmOd45GloRWpUFh4R0u9ADha01ULOmugdbfQwF20oR6bvUKV7LjVTT AWpQ== X-Gm-Message-State: APf1xPASWlXT6RCywL6Xt7I0yGtuaYkJ9dJs8xKPAiz8Tc5rMiNyZGow GggdYXZ7VEeH2ogNgMe5CXaGWKqSL/8hOo1luTI= X-Received: by 10.31.107.133 with SMTP id k5mr106005vki.177.1518070910255; Wed, 07 Feb 2018 22:21:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.70.21 with HTTP; Wed, 7 Feb 2018 22:21:49 -0800 (PST) In-Reply-To: <1518069400-7037-1-git-send-email-yamada.masahiro@socionext.com> References: <1518069400-7037-1-git-send-email-yamada.masahiro@socionext.com> From: Ulf Magnusson Date: Thu, 8 Feb 2018 07:21:49 +0100 Message-ID: Subject: Re: [PATCH 1/2] kconfig: remove check_stdin() To: Masahiro Yamada Cc: Linux Kbuild mailing list , Sam Ravnborg , Michal Marek , Randy Dunlap , "Luis R . Rodriguez" , Linux Kernel Mailing List , Marc Herbert Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 8, 2018 at 6:56 AM, Masahiro Yamada wrote: > Except silentoldconfig, valid_stdin is 1, so check_stdin() is no-op. > > oldconfig and silentoldconfig work almost in the same way except that > the latter generates additional files. Both ask users for input for > new symbols. > > I do not know why only silentoldconfig requires stdio be tty. > > $ rm -f .config; touch .config > $ yes "" | make oldconfig > stdout > $ rm -f .config; touch .config > $ yes "" | make silentoldconfig > stdout > make[1]: *** [silentoldconfig] Error 1 > make: *** [silentoldconfig] Error 2 > $ tail -n 4 stdout > Console input/output is redirected. Run 'make oldconfig' to update configuration. > > scripts/kconfig/Makefile:40: recipe for target 'silentoldconfig' failed > Makefile:507: recipe for target 'silentoldconfig' failed > > Redirection is useful, for example, for testing where we want to give > particular key inputs from a test file, then check the result. > > Signed-off-by: Masahiro Yamada > --- > > scripts/kconfig/conf.c | 14 -------------- > 1 file changed, 14 deletions(-) > > diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c > index 307bc3f..358e2e4 100644 > --- a/scripts/kconfig/conf.c > +++ b/scripts/kconfig/conf.c > @@ -39,7 +39,6 @@ static enum input_mode input_mode = oldaskconfig; > > static int indent = 1; > static int tty_stdio; > -static int valid_stdin = 1; > static int sync_kconfig; > static int conf_cnt; > static char line[PATH_MAX]; > @@ -72,16 +71,6 @@ static void strip(char *str) > *p-- = 0; > } > > -static void check_stdin(void) > -{ > - if (!valid_stdin) { > - printf(_("aborted!\n\n")); > - printf(_("Console input/output is redirected. ")); > - printf(_("Run 'make oldconfig' to update configuration.\n\n")); > - exit(1); > - } > -} > - > /* Helper function to facilitate fgets() by Jean Sacren. */ > static void xfgets(char *str, int size, FILE *in) > { > @@ -113,7 +102,6 @@ static int conf_askvalue(struct symbol *sym, const char *def) > printf("%s\n", def); > return 0; > } > - check_stdin(); > /* fall through */ > case oldaskconfig: > fflush(stdout); > @@ -315,7 +303,6 @@ static int conf_choice(struct menu *menu) > printf("%d\n", cnt); > break; > } > - check_stdin(); > /* fall through */ > case oldaskconfig: > fflush(stdout); > @@ -650,7 +637,6 @@ int main(int ac, char **av) > return 1; > } > } > - valid_stdin = tty_stdio; > } > > switch (input_mode) { > -- > 2.7.4 > Reviewed-by: Ulf Magnusson Lots of weird stuff indeed... Cheers, Ulf