[BACK]Return to midi.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sndiod

Diff for /src/usr.bin/sndiod/midi.c between version 1.3 and 1.4

version 1.3, 2012/11/30 20:48:00 version 1.4, 2012/11/30 21:04:35
Line 452 
Line 452 
  * create a new midi port   * create a new midi port
  */   */
 struct port *  struct port *
 port_new(char *path, unsigned int mode)  port_new(char *path, unsigned int mode, int hold)
 {  {
         struct port *c;          struct port *c;
   
         c = xmalloc(sizeof(struct port));          c = xmalloc(sizeof(struct port));
         c->path = path;          c->path = path;
         c->state = PORT_CFG;          c->state = PORT_CFG;
           c->hold = hold;
         c->midi = midi_new(&port_midiops, c, mode);          c->midi = midi_new(&port_midiops, c, mode);
         midi_portnum++;          midi_portnum++;
         c->next = port_list;          c->next = port_list;
Line 516 
Line 517 
 #endif  #endif
         for (rxmask = 0, i = 0; i < MIDI_NEP; i++)          for (rxmask = 0, i = 0; i < MIDI_NEP; i++)
                 rxmask |= midi_ep[i].txmask;                  rxmask |= midi_ep[i].txmask;
         if ((rxmask & c->midi->self) == 0 && c->state == PORT_INIT)          if ((rxmask & c->midi->self) == 0 && c->state == PORT_INIT && !c->hold)
                 port_close(c);                  port_close(c);
 }  }
   
Line 573 
Line 574 
 int  int
 port_init(struct port *c)  port_init(struct port *c)
 {  {
         return port_open(c);          if (c->hold)
                   return port_open(c);
           return 1;
 }  }
   
 void  void

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4