[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.53 and 1.54

version 1.53, 2019/07/10 14:30:39 version 1.54, 2019/07/12 06:30:55
Line 1527 
Line 1527 
  * allocate a new slot and register the given call-backs   * allocate a new slot and register the given call-backs
  */   */
 struct slot *  struct slot *
 slot_new(struct dev *d, struct opt *opt, char *who,  slot_new(struct dev *d, struct opt *opt, unsigned int id, char *who,
     struct slotops *ops, void *arg, int mode)      struct slotops *ops, void *arg, int mode)
 {  {
         char *p;          char *p;
Line 1563 
Line 1563 
         }          }
   
         /*          /*
            * find the free slot with the least unit number and same id
            */
           for (i = 0; i < DEV_NSLOT; i++) {
                   s = unit[i];
                   if (s != NULL && s->ops == NULL && s->id == id)
                           goto found;
           }
   
           /*
          * find the free slot with the least unit number           * find the free slot with the least unit number
          */           */
         for (i = 0; i < DEV_NSLOT; i++) {          for (i = 0; i < DEV_NSLOT; i++) {
                 s = unit[i];                  s = unit[i];
                 if (s != NULL && s->ops == NULL)                  if (s != NULL && s->ops == NULL) {
                           s->id = id;
                         goto found;                          goto found;
                   }
         }          }
   
         /*          /*
Line 1594 
Line 1605 
                 for (i = 0; unit[i] != NULL; i++)                  for (i = 0; unit[i] != NULL; i++)
                         ; /* nothing */                          ; /* nothing */
                 s->unit = i;                  s->unit = i;
                   s->id = id;
                 goto found;                  goto found;
         }          }
   

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