From owner-freebsd-bugs Fri Mar 14 13: 0:28 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C11237B401 for ; Fri, 14 Mar 2003 13:00:24 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 015F843F75 for ; Fri, 14 Mar 2003 13:00:24 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h2EL0NNS039349 for ; Fri, 14 Mar 2003 13:00:23 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h2EL0NTP039348; Fri, 14 Mar 2003 13:00:23 -0800 (PST) Date: Fri, 14 Mar 2003 13:00:23 -0800 (PST) Message-Id: <200303142100.h2EL0NTP039348@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Lyndon Nerenberg {VE6BBM} Subject: Re: bin/7868 [almost patch]Morse Code Fixups Reply-To: Lyndon Nerenberg {VE6BBM} 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 The following reply was made to PR bin/7868; it has been noted by GNATS. From: Lyndon Nerenberg {VE6BBM} To: freebsd-gnats-submit@freebsd.org Cc: Subject: Re: bin/7868 [almost patch]Morse Code Fixups Date: Fri, 14 Mar 2003 13:54:27 -0700 Attached is an updated patch that applies 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:48:52 @@ -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:48:52 @@ -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:48:53 @@ -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) { @@ -393,7 +399,7 @@ printf(" %s", s); else for (; *s; ++s) - printf(" %s", *s == '.' ? "dit" : "dah"); + printf(" %s", *s == '.' ? *(s+1) == '\0' ? "dit" : "di" : "dah"); printf("\n"); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message