Date: Tue, 27 Feb 2018 16:32:47 -0800 From: Conrad Meyer <cem@freebsd.org> To: Mike Karels <karels@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330091 - head/bin/ps Message-ID: <CAG6CVpXvQmHcPcp-cNQ8O1yaFW47chOA4JujEuAe%2BFnK63AQqQ@mail.gmail.com> In-Reply-To: <201802280017.w1S0H8Qx017156@repo.freebsd.org> References: <201802280017.w1S0H8Qx017156@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <karels@freebsd.org> 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) || >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpXvQmHcPcp-cNQ8O1yaFW47chOA4JujEuAe%2BFnK63AQqQ>