From owner-freebsd-bugs Fri Mar 14 12:18:19 2003 Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4980A37B401 for ; Fri, 14 Mar 2003 12:18:16 -0800 (PST) Received: from orthanc.ab.ca (orthanc.ab.ca [216.123.230.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A0B343F75 for ; Fri, 14 Mar 2003 12:18:15 -0800 (PST) (envelope-from lyndon@orthanc.ab.ca) Received: from orthanc.ab.ca (localhost4 [127.0.0.1]) by orthanc.ab.ca (8.12.6/8.12.6) with ESMTP id h2EKIEKU065233 for ; Fri, 14 Mar 2003 13:18:14 -0700 (MST) (envelope-from lyndon@orthanc.ab.ca) Message-Id: <200303142018.h2EKIEKU065233@orthanc.ab.ca> From: Lyndon Nerenberg {VE6BBM} To: freebsd-bugs@freebsd.org Subject: Re: bin/7868: morse(6) fixups Organization: The Frobozz Magic Homing Pigeon Company X-Mailer: MH-E 7.2+cvs; nmh 1.0.4; GNU Emacs 21.2.2 Date: Fri, 14 Mar 2003 13:18:14 -0700 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Here is an updated patch against 5.0-RELEASE. Index: Makefile =================================================================== RCS file: /home/ncvs/src/games/morse/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- Makefile 2001/03/26 14:20:58 1.7 +++ Makefile 2003/03/14 20:17:23 @@ -4,8 +4,4 @@ PROG= morse MAN= morse.6 -.if ${MACHINE_ARCH} == "i386" -CFLAGS += -DSPEAKER=\"/dev/speaker\" -.endif - .include Index: morse.6 =================================================================== RCS file: /home/ncvs/src/games/morse/morse.6,v retrieving revision 1.10 diff -u -r1.10 morse.6 --- morse.6 2001/08/07 15:48:28 1.10 +++ morse.6 2003/03/14 20:17:23 @@ -135,7 +135,8 @@ .Sh FILES .Bl -tag -width /dev/speaker -compact .It Pa /dev/speaker -speaker device file +.Xr speaker 4 +device file .El .Sh ENVIRONMENT If your @@ -158,7 +159,7 @@ Sound support for .Nm added by -.An Lyndon Nerenberg (VE7TCP/VE6BBM) Aq lyndon@orthanc.com . +.An Lyndon Nerenberg (VE6BBM) Aq lyndon@orthanc.ab.ca . .Pp Ability to key an external device added by .An J\(:org Wunsch Index: morse.c =================================================================== RCS file: /home/ncvs/src/games/morse/morse.c,v retrieving revision 1.14 diff -u -r1.14 morse.c --- morse.c 2001/06/26 01:43:52 1.14 +++ morse.c 2003/03/14 20:17:23 @@ -32,8 +32,8 @@ */ /* - * Taught to send *real* morse by Lyndon Nerenberg (VE7TCP/VE6BBM) - * + * Taught to send *real* morse by Lyndon Nerenberg (VE6BBM) + * */ #ifndef lint @@ -63,9 +63,13 @@ #include #include -#ifdef SPEAKER -#include -#endif +#include +#if defined(__FreeBSD__) && defined(__i386__) /* spkr(4) exists only on */ + /* Intel platforms. */ +# define SPEAKER +# include +# include +#endif /* __FreeBSD__ && __i386__ */ struct morsetab { char inchar; @@ -276,17 +280,19 @@ if ((pflag || device) && (freq == 0)) freq = FREQUENCY; -#ifdef SPEAKER if (pflag) { - if ((spkr = open(SPEAKER, O_WRONLY, 0)) == -1) { - perror(SPEAKER); +#ifdef SPEAKER + if ((spkr = open("/dev/speaker", O_WRONLY, 0)) == -1) { + perror("/dev/speaker"); exit(1); } +#else /* ! SPEAKER */ + errx(1, "speaker device not supported on this platform"); +#endif /* ! SPEAKER */ } else -#endif if (device) { if ((line = open(device, O_WRONLY | O_NONBLOCK)) == -1) { - perror("open tty line"); + perror(device); exit(1); } if (tcgetattr(line, &otty) == -1) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message