Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170082287
D14530.id39815.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14530.id39815.diff
View Options
Index: head/bin/ps/ps.c
===================================================================
--- head/bin/ps/ps.c
+++ head/bin/ps/ps.c
@@ -194,10 +194,17 @@
(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) ||
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 4, 11:18 AM (17 h, 33 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38168826
Default Alt Text
D14530.id39815.diff (1 KB)
Attached To
Mode
D14530: Revert r314685 in ps
Attached
Detach File
Event Timeline
Log In to Comment