From owner-freebsd-bugs Wed Aug 11 5:30:36 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 7D5751551A for ; Wed, 11 Aug 1999 05:30:22 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id FAA19937; Wed, 11 Aug 1999 05:30:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from po3.wam.umd.edu (po3.wam.umd.edu [128.8.10.165]) by hub.freebsd.org (Postfix) with ESMTP id 1675714DF5 for ; Wed, 11 Aug 1999 05:22:11 -0700 (PDT) (envelope-from howardjp@wam.umd.edu) Received: from rac10.wam.umd.edu (root@rac10.wam.umd.edu [128.8.10.150]) by po3.wam.umd.edu (8.9.3/8.9.3) with ESMTP id IAA11286 for ; Wed, 11 Aug 1999 08:21:05 -0400 (EDT) Received: from rac10.wam.umd.edu (sendmail@localhost [127.0.0.1]) by rac10.wam.umd.edu (8.9.3/8.9.3) with SMTP id IAA04691 for ; Wed, 11 Aug 1999 08:21:04 -0400 (EDT) Received: (from howardjp@localhost) by rac10.wam.umd.edu (8.9.3/8.9.3) id IAA04687 for FreeBSD-gnats-submit@freebsd.org; Wed, 11 Aug 1999 08:21:04 -0400 (EDT) Message-Id: <199908111221.IAA04687@rac10.wam.umd.edu> Date: Wed, 11 Aug 1999 08:21:04 -0400 (EDT) From: James Howard Reply-To: howardjp@wam.umd.edu To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/13073: Extensions to mesg(1) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 13073 >Category: bin >Synopsis: Extensions to mesg(1) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Aug 11 05:30:04 PDT 1999 >Closed-Date: >Last-Modified: >Originator: James Howard >Release: FreeBSD 3.2-STABLE i386 >Organization: University of Maryland >Environment: FreeBSD byzantine 3.2-STABLE FreeBSD 3.2-STABLE #5: Sat Aug 7 23:43:54 GMT 1999 root@byzantine:/usr/src/sys/compile/BYZANTINE i386 >Description: Often when I am logged in via telnet to a FreeBSD host, I use Lynx to download files. If it is a large download, the arrival of talk requests or write messages can mess up the display of Lynx's status. This patch to mesg(1) will allow you to use "mesg -t tty" report or change the status of tty instead of the current. I do this often from a second telnet session. >How-To-Repeat: Irrelevant. >Fix: diff -c /usr/src/usr.bin/mesg/mesg.1 /usr/local/src/usr.bin/mesg/mesg.1 *** /usr/src/usr.bin/mesg/mesg.1 Thu Jul 24 06:59:00 1997 --- /usr/local/src/usr.bin/mesg/mesg.1 Wed Aug 11 00:36:42 1999 *************** *** 40,45 **** --- 40,46 ---- .Nd display (do not display) messages from other users .Sh SYNOPSIS .Nm + .Op Fl t Ar tty .Op Cm n | Cm y .Sh DESCRIPTION The *************** *** 54,60 **** may display messages on the terminal. .Pp Options available: ! .Bl -tag -width flag .It Cm n Disallows messages. .It Cm y --- 55,65 ---- may display messages on the terminal. .Pp Options available: ! .Bl -tag -width 8n ! .It Fl t Ar tty ! Report or change the status of ! .Ar tty ! rather than the current terminal. .It Cm n Disallows messages. .It Cm y diff -c /usr/src/usr.bin/mesg/mesg.c /usr/local/src/usr.bin/mesg/mesg.c *** /usr/src/usr.bin/mesg/mesg.c Thu Jul 24 06:59:00 1997 --- /usr/local/src/usr.bin/mesg/mesg.c Wed Aug 11 00:33:53 1999 *************** *** 54,59 **** --- 54,60 ---- #include #include + #include #include #include #include *************** *** 70,77 **** char *tty; int ch; ! while ((ch = getopt(argc, argv, "")) != -1) switch (ch) { case '?': default: usage(); --- 71,82 ---- char *tty; int ch; ! tty = NULL; ! while ((ch = getopt(argc, argv, "t:")) != -1) switch (ch) { + case 't': + tty = optarg; + break; case '?': default: usage(); *************** *** 79,86 **** argc -= optind; argv += optind; ! if ((tty = ttyname(STDERR_FILENO)) == NULL) ! err(1, "ttyname"); if (stat(tty, &sb) < 0) err(1, "%s", tty); --- 84,93 ---- argc -= optind; argv += optind; ! if (tty == NULL) ! if ((tty = ttyname(STDERR_FILENO)) == NULL) ! err(1, "ttyname"); ! (void)chdir(_PATH_DEV); if (stat(tty, &sb) < 0) err(1, "%s", tty); *************** *** 111,116 **** static void usage() { ! (void)fprintf(stderr, "usage: mesg [y | n]\n"); exit(2); } --- 118,123 ---- static void usage() { ! (void)fprintf(stderr, "usage: mesg [-t tty] [y | n]\n"); exit(2); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message