From owner-freebsd-bugs Fri Feb 16 17:30:10 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D5FCD37B4EC for ; Fri, 16 Feb 2001 17:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f1H1U1F01102; Fri, 16 Feb 2001 17:30:01 -0800 (PST) (envelope-from gnats) Received: from hand.dotat.at (sfo-gw.covalent.net [207.44.198.62]) by hub.freebsd.org (Postfix) with ESMTP id 4441937B491 for ; Fri, 16 Feb 2001 17:28:32 -0800 (PST) Received: from fanf by hand.dotat.at with local (Exim 3.20 #3) id 14TwAk-0003Z0-00 for FreeBSD-gnats-submit@freebsd.org; Sat, 17 Feb 2001 01:28:26 +0000 Message-Id: Date: Sat, 17 Feb 2001 01:28:26 +0000 From: Tony Finch Reply-To: Tony Finch To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/25156: [PATCH] Improved user-interface for mixer(8) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25156 >Category: bin >Synopsis: Improved user-interface for mixer(8) >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: Fri Feb 16 17:30:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Tony Finch >Release: FreeBSD 4.2-STABLE i386 >Organization: Covalent Technologies, Inc. >Environment: FreeBSD hand.dotat.at 4.2-STABLE FreeBSD 4.2-STABLE #2: Thu Feb 8 08:45:48 GMT 2001 fanf@hand.dotat.at:/FreeBSD/obj/FreeBSD/releng4/sys/DELL-Latitude-CSx i386 >Description: A very common operation with mixer(8) is to change the overall sound volume. At the moment you must do this with a command like "mixer vol 75"; the patch below allows you to omit the first argument in which case it assumes "vol". >How-To-Repeat: >Fix: --- /usr/src/usr.sbin/mixer/mixer.c 2000/10/26 14:39:35 1.11.2.2 +++ /usr/src/usr.sbin/mixer/mixer.c 2001/02/17 01:21:33 @@ -181,13 +181,9 @@ continue; } - if ((dev = res_name(*argv, devmask)) == -1) { - warnx("unknown device: %s", *argv); - dusage = 1; - break; - } - - switch(argc > 1 ? sscanf(argv[1], "%d:%d", &l, &r) : 0) { + dev = res_name(*argv, devmask); + switch(dev == -1 ? -sscanf(argv[0], "%d", &l) : + argc > 1 ? sscanf(argv[1], "%d:%d", &l, &r) : 0) { case 0: if (ioctl(baz, MIXER_READ(dev),&bar)== -1) { warn("MIXER_READ"); @@ -202,6 +198,13 @@ argc--; argv++; break; + case -1: + if ((dev = res_name("vol", devmask)) == -1) { + warnx("unknown device: %s", *argv); + dusage = 1; + break; + } + argc += 1; argv -= 1; case 1: r = l; case 2: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message