From owner-freebsd-hackers Fri Mar 16 10:13:12 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from cx420564-b.tucson1.az.home.com (cx420564-b.tucson1.az.home.com [24.21.112.225]) by hub.freebsd.org (Postfix) with ESMTP id 98C1637B718 for ; Fri, 16 Mar 2001 10:13:09 -0800 (PST) (envelope-from fracture@cx420564-b.tucson1.az.home.com) Received: (from fracture@localhost) by cx420564-b.tucson1.az.home.com (8.11.1/8.11.1) id f2GB4rt20128 for freebsd-hackers@freebsd.org; Fri, 16 Mar 2001 11:04:53 GMT (envelope-from fracture) Date: Fri, 16 Mar 2001 11:04:43 +0000 From: Jordan DeLong To: freebsd-hackers@freebsd.org Subject: /bin/ps thing Message-ID: <20010316110443.A20103@cx420564-b.tucson1.az.home.com> Mail-Followup-To: Jordan DeLong , freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline First let me state that I really don't know the proper place to be putting this. If this is the wrong list, I appologize, please let me know the prefered method for submitting minor patches. It seemed that send-pr was just for reporting issues, not for fixing them also, if this should've gone through send-pr....well...oops :P this is just a fix for this: a common way to look for pids ps aux | grep myps but even though stdout isn't a tty ps tries to use 79 col, and I don't like typeing ps wwaux | grep myps. so this patch just checks if stdout is a tty, if not it defaults to UNLIMITED. -Jordan --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ps.diff" diff -crN /usr/src/bin/ps/ps.c ps/ps.c *** /usr/src/bin/ps/ps.c Sat Jul 8 05:14:43 2000 --- ps/ps.c Fri Mar 16 10:56:18 2001 *************** *** 127,139 **** (void) setlocale(LC_ALL, ""); ! if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && ! ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && ! ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&ws) == -1) || ! ws.ws_col == 0) ! termwidth = 79; ! else ! termwidth = ws.ws_col - 1; if (argc > 1) argv[1] = kludge_oldps_options(argv[1]); --- 127,143 ---- (void) setlocale(LC_ALL, ""); ! if (isatty(STDOUT_FILENO)) { ! if ((ioctl(STDOUT_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && ! ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && ! ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&ws) == -1) || ! ws.ws_col == 0) ! termwidth = 79; ! else ! termwidth = ws.ws_col - 1; ! } else { ! termwidth = UNLIMITED; ! } if (argc > 1) argv[1] = kludge_oldps_options(argv[1]); --qDbXVdCdHGoSgWSk-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message