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

Diff for /src/usr.bin/sndiod/siofile.c between version 1.20 and 1.21

version 1.20, 2020/06/12 15:40:18 version 1.21, 2020/06/18 05:11:13
Line 93 
Line 93 
 static struct sio_hdl *  static struct sio_hdl *
 dev_sio_openlist(struct dev *d, unsigned int mode, struct sioctl_hdl **rctlhdl)  dev_sio_openlist(struct dev *d, unsigned int mode, struct sioctl_hdl **rctlhdl)
 {  {
         struct name *n;          struct dev_alt *n;
         struct sio_hdl *hdl;          struct sio_hdl *hdl;
         struct sioctl_hdl *ctlhdl;          struct sioctl_hdl *ctlhdl;
         int idx;  
   
         idx = 0;          for (n = d->alt_list; n != NULL; n = n->next) {
         n = d->path_list;                  if (d->alt_num == n->idx)
         while (1) {                          continue;
                 if (n == NULL)                  hdl = fdpass_sio_open(d->num, n->idx, mode);
                         break;  
                 hdl = fdpass_sio_open(d->num, idx, mode);  
                 if (hdl != NULL) {                  if (hdl != NULL) {
                         if (log_level >= 2) {                          if (log_level >= 2) {
                                 dev_log(d);                                  dev_log(d);
                                 log_puts(": using ");                                  log_puts(": using ");
                                 log_puts(n->str);                                  log_puts(n->name);
                                 log_puts("\n");                                  log_puts("\n");
                         }                          }
                         ctlhdl = fdpass_sioctl_open(d->num, idx,                          ctlhdl = fdpass_sioctl_open(d->num, n->idx,
                             SIOCTL_READ | SIOCTL_WRITE);                              SIOCTL_READ | SIOCTL_WRITE);
                         if (ctlhdl == NULL) {                          if (ctlhdl == NULL) {
                                 if (log_level >= 1) {                                  if (log_level >= 1) {
Line 119 
Line 116 
                                         log_puts(": no control device\n");                                          log_puts(": no control device\n");
                                 }                                  }
                         }                          }
                           d->alt_num = n->idx;
                         *rctlhdl = ctlhdl;                          *rctlhdl = ctlhdl;
                         return hdl;                          return hdl;
                 }                  }
                 n = n->next;  
                 idx++;  
         }          }
         return NULL;          return NULL;
 }  }
Line 378 
Line 374 
                 sioctl_close(d->sioctl.hdl);                  sioctl_close(d->sioctl.hdl);
                 d->sioctl.hdl = NULL;                  d->sioctl.hdl = NULL;
         }          }
           d->alt_num = -1;
 }  }
   
 void  void

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21