From owner-svn-src-head@freebsd.org Wed Feb 28 00:32:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED670F38E63; Wed, 28 Feb 2018 00:32:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B71679D00; Wed, 28 Feb 2018 00:32:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f169.google.com with SMTP id e7so1311958ioj.1; Tue, 27 Feb 2018 16:32:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=iWn3NJ02lS5krRkAbxEGn1QpzdKXe2PIcAXiiVH8AgY=; b=JwQQtPiMs47Xcm/lu5iK/GpWBC3LKFS/ozPlOruCaYo8aF6X8qPMqf5yvup6HiiOIO Oyx6BSQO2HtwTfgaGhi82InAGbIk7tVhLCTgHQqd8vAKZnnQwQFlaR4obrR2SfwGsh/1 8Ab+BN37Lvf8VeUvDtOAeG8lZrsd2ttcdFbD7hvNxlx+AAdjJAMK1SRLfuotQNLri7qS DO0ofhF/1KhOVAHsRyknCJ9Pn41HiviMPsjGAYZk1q+JNxhbkYz2xVlZr7arQ8TJr3z6 uKOB+BbJtrl3up/bTnn9vreRICfedh1JV0l8jQGpqVZCpsOWEN1JcCiSsI+Z3vk/6WLe 48Ig== X-Gm-Message-State: APf1xPAo97cU89uUxTWHaCybOwO4VlrQaWJkTd2RkBZsggx8IBSEit5I 7GYsuJ261A4ZGS8nawQfA6qhkOHm X-Google-Smtp-Source: AG47ELsIvq3x9aZwMM6OgG8YZ85kNQiwgTcT63CpwYcPCBcp10jQQ7FnEw1NSYapNtwc9JR3VzHaNg== X-Received: by 10.107.180.196 with SMTP id d187mr18449891iof.187.1519777968764; Tue, 27 Feb 2018 16:32:48 -0800 (PST) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com. [209.85.214.54]) by smtp.gmail.com with ESMTPSA id c74sm280842ioe.10.2018.02.27.16.32.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 16:32:48 -0800 (PST) Received: by mail-it0-f54.google.com with SMTP id u5so1424262itc.1; Tue, 27 Feb 2018 16:32:48 -0800 (PST) X-Received: by 10.36.3.67 with SMTP id e64mr19279760ite.46.1519777968297; Tue, 27 Feb 2018 16:32:48 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Tue, 27 Feb 2018 16:32:47 -0800 (PST) In-Reply-To: <201802280017.w1S0H8Qx017156@repo.freebsd.org> References: <201802280017.w1S0H8Qx017156@repo.freebsd.org> From: Conrad Meyer Date: Tue, 27 Feb 2018 16:32:47 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330091 - head/bin/ps To: Mike Karels Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 00:32:56 -0000 This is probably the wrong change to make. It makes us incompatible with Linux and Mac OS. Anyway, I'll reopen the associated PR and you can handle it how you like. Conrad On Tue, Feb 27, 2018 at 4:17 PM, Mike Karels wrote: > Author: karels > Date: Wed Feb 28 00:17:08 2018 > New Revision: 330091 > URL: https://svnweb.freebsd.org/changeset/base/330091 > > Log: > Revert r314685 in ps > > Revert r314685, and add a comment describing the original > behavior and the intent. > > Reviewed by: dab@ vangyzen@ jhb@ > Differential Revision: https://reviews.freebsd.org/D14530 > > Modified: > head/bin/ps/ps.c > > Modified: head/bin/ps/ps.c > ============================================================================== > --- head/bin/ps/ps.c Tue Feb 27 22:22:23 2018 (r330090) > +++ head/bin/ps/ps.c Wed Feb 28 00:17:08 2018 (r330091) > @@ -194,10 +194,17 @@ main(int argc, char *argv[]) > (void) setlocale(LC_ALL, ""); > time(&now); /* Used by routines in print.c. */ > > + /* > + * Compute default output line length before processing options. > + * If COLUMNS is set, use it. Otherwise, if this is part of an > + * interactive job (i.e. one associated with a terminal), use > + * the terminal width. "Interactive" is determined by whether > + * any of stdout, stderr, or stdin is a terminal. The intent > + * is that "ps", "ps | more", and "ps | grep" all use the same > + * default line length unless -w is specified. > + */ > if ((cols = getenv("COLUMNS")) != NULL && *cols != '\0') > termwidth = atoi(cols); > - else if (!isatty(STDOUT_FILENO)) > - termwidth = UNLIMITED; > else if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && > ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && > ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&ws) == -1) || >