Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/midiplay Don't open sequencer device if we're not go...



details:   https://anonhg.NetBSD.org/src/rev/3f9269849221
branches:  trunk
changeset: 518137:3f9269849221
user:      augustss <augustss%NetBSD.org@localhost>
date:      Sun Nov 25 12:29:52 2001 +0000

description:
Don't open sequencer device if we're not going to play.

diffstat:

 usr.bin/midiplay/midiplay.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 3b001ae1ff01 -r 3f9269849221 usr.bin/midiplay/midiplay.c
--- a/usr.bin/midiplay/midiplay.c       Sun Nov 25 11:41:09 2001 +0000
+++ b/usr.bin/midiplay/midiplay.c       Sun Nov 25 12:29:52 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: midiplay.c,v 1.14 2001/10/30 17:10:50 augustss Exp $   */
+/*     $NetBSD: midiplay.c,v 1.15 2001/11/25 12:29:52 augustss Exp $   */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -139,7 +139,7 @@
 u_int ttempo = 100;
 int unit = 0;
 int play = 1;
-int fd;
+int fd = -1;
 int sameprogram = 0;
 
 void
@@ -531,6 +531,9 @@
        argc -= optind;
        argv += optind;
     
+       if (!play)
+               goto output;
+
        fd = open(file, O_WRONLY);
        if (fd < 0)
                err(1, "%s", file);
@@ -564,6 +567,8 @@
                err(1, "SEQUENCER_TMR_START");
 
        midireset();
+
+ output:
        if (example)
                while (example--)
                        playdata(sample, sizeof sample, "<Gubben Noa>");



Home | Main Index | Thread Index | Old Index