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

Diff for /src/usr.bin/sndiod/fdpass.c between version 1.8 and 1.9

version 1.8, 2020/01/23 05:40:09 version 1.9, 2020/02/26 13:53:58
Line 32 
Line 32 
 struct fdpass_msg {  struct fdpass_msg {
 #define FDPASS_OPEN_SND         0       /* open an audio device */  #define FDPASS_OPEN_SND         0       /* open an audio device */
 #define FDPASS_OPEN_MIDI        1       /* open a midi port */  #define FDPASS_OPEN_MIDI        1       /* open a midi port */
   #define FDPASS_OPEN_CTL         2       /* open an audio control device */
 #define FDPASS_RETURN           3       /* return after above commands */  #define FDPASS_RETURN           3       /* return after above commands */
         unsigned int cmd;               /* one of above */          unsigned int cmd;               /* one of above */
         unsigned int num;               /* audio device or midi port number */          unsigned int num;               /* audio device or midi port number */
Line 287 
Line 288 
         return mio_rmidi_fdopen(fd, mode, 1);          return mio_rmidi_fdopen(fd, mode, 1);
 }  }
   
   struct sioctl_hdl *
   fdpass_sioctl_open(int num, int idx, unsigned int mode)
   {
           int fd;
   
           if (fdpass_peer == NULL)
                   return NULL;
           if (!fdpass_send(fdpass_peer, FDPASS_OPEN_CTL, num, idx, mode, -1))
                   return NULL;
           if (!fdpass_waitret(fdpass_peer, &fd))
                   return NULL;
           if (fd < 0)
                   return NULL;
           return sioctl_sun_fdopen(fd, mode, 1);
   }
   
 void  void
 fdpass_in_worker(void *arg)  fdpass_in_worker(void *arg)
 {  {
Line 345 
Line 362 
                         return;                          return;
                 }                  }
                 fd = mio_rmidi_getfd(path, mode, 1);                  fd = mio_rmidi_getfd(path, mode, 1);
                   break;
           case FDPASS_OPEN_CTL:
                   d = dev_bynum(num);
                   if (d == NULL || !(mode & (SIOCTL_READ | SIOCTL_WRITE))) {
                           if (log_level >= 1) {
                                   fdpass_log(f);
                                   log_puts(": bad audio control device\n");
                           }
                           fdpass_close(f);
                           return;
                   }
                   path = namelist_byindex(&d->path_list, idx);
                   if (path == NULL) {
                           fdpass_close(f);
                           return;
                   }
                   fd = sioctl_sun_getfd(path, mode, 1);
                 break;                  break;
         default:          default:
                 fdpass_close(f);                  fdpass_close(f);

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9