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

Diff for /src/usr.bin/sndiod/dev.c between version 1.54 and 1.55

version 1.54, 2019/07/12 06:30:55 version 1.55, 2019/08/29 07:07:33
Line 1108 
Line 1108 
 }  }
   
 /*  /*
  * force the device to go in DEV_CFG state, the caller is supposed to   * Force all slots to exit
  * ensure buffers are drained  
  */   */
 void  void
 dev_close(struct dev *d)  dev_exitall(struct dev *d)
 {  {
         int i;          int i;
         struct slot *s;          struct slot *s;
   
           for (s = d->slot, i = DEV_NSLOT; i > 0; i--, s++) {
                   if (s->ops)
                           s->ops->exit(s->arg);
                   s->ops = NULL;
           }
           d->slot_list = NULL;
   }
   
   /*
    * force the device to go in DEV_CFG state, the caller is supposed to
    * ensure buffers are drained
    */
   void
   dev_close(struct dev *d)
   {
 #ifdef DEBUG  #ifdef DEBUG
         if (log_level >= 3) {          if (log_level >= 3) {
                 dev_log(d);                  dev_log(d);
Line 1124 
Line 1138 
         }          }
 #endif  #endif
         d->pstate = DEV_CFG;          d->pstate = DEV_CFG;
         for (s = d->slot, i = DEV_NSLOT; i > 0; i--, s++) {          dev_exitall(d);
                 if (s->ops)  
                         s->ops->exit(s->arg);  
                 s->ops = NULL;  
         }  
         d->slot_list = NULL;  
         dev_sio_close(d);          dev_sio_close(d);
         if (d->mode & MODE_PLAY) {          if (d->mode & MODE_PLAY) {
                 if (d->encbuf != NULL)                  if (d->encbuf != NULL)

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55