=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sndiod/midi.c,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** src/usr.bin/sndiod/midi.c 2012/11/30 20:48:00 1.3 --- src/usr.bin/sndiod/midi.c 2012/11/30 21:04:35 1.4 *************** *** 1,4 **** ! /* $OpenBSD: midi.c,v 1.3 2012/11/30 20:48:00 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * --- 1,4 ---- ! /* $OpenBSD: midi.c,v 1.4 2012/11/30 21:04:35 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * *************** *** 452,464 **** * create a new midi port */ struct port * ! port_new(char *path, unsigned int mode) { struct port *c; c = xmalloc(sizeof(struct port)); c->path = path; c->state = PORT_CFG; c->midi = midi_new(&port_midiops, c, mode); midi_portnum++; c->next = port_list; --- 452,465 ---- * create a new midi port */ struct port * ! port_new(char *path, unsigned int mode, int hold) { struct port *c; c = xmalloc(sizeof(struct port)); c->path = path; c->state = PORT_CFG; + c->hold = hold; c->midi = midi_new(&port_midiops, c, mode); midi_portnum++; c->next = port_list; *************** *** 516,522 **** #endif for (rxmask = 0, i = 0; i < MIDI_NEP; i++) rxmask |= midi_ep[i].txmask; ! if ((rxmask & c->midi->self) == 0 && c->state == PORT_INIT) port_close(c); } --- 517,523 ---- #endif for (rxmask = 0, i = 0; i < MIDI_NEP; i++) rxmask |= midi_ep[i].txmask; ! if ((rxmask & c->midi->self) == 0 && c->state == PORT_INIT && !c->hold) port_close(c); } *************** *** 573,579 **** int port_init(struct port *c) { ! return port_open(c); } void --- 574,582 ---- int port_init(struct port *c) { ! if (c->hold) ! return port_open(c); ! return 1; } void