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

Diff for /src/usr.bin/aucat/Attic/file.c between version 1.8 and 1.9

version 1.8, 2008/12/27 14:23:40 version 1.9, 2008/12/29 17:59:08
Line 157 
Line 157 
                 DPRINTF("file_poll: nothing to do...\n");                  DPRINTF("file_poll: nothing to do...\n");
                 return 0;                  return 0;
         }          }
         if (poll(pfds, nfds, -1) < 0) {          if (nfds > 0) {
                 if (errno == EINTR)                  if (poll(pfds, nfds, -1) < 0) {
                         return 1;                          if (errno == EINTR)
                 err(1, "file_poll: poll failed");                                  return 1;
                           err(1, "file_poll: poll failed");
                   }
         }          }
         f = LIST_FIRST(&file_list);          f = LIST_FIRST(&file_list);
         while (f != LIST_END(&file_list)) {          while (f != LIST_END(&file_list)) {
Line 318 
Line 320 
                 DPRINTFN(2, "file_hup: %s: delayed\n", f->name);                  DPRINTFN(2, "file_hup: %s: delayed\n", f->name);
                 f->state &= ~FILE_WOK;                  f->state &= ~FILE_WOK;
                 f->state |= FILE_HUP;                  f->state |= FILE_HUP;
           }
   }
   
   void
   file_close(struct file *f)
   {
           struct aproc *p;
   
           if (f->refs == 0) {
                   DPRINTFN(2, "file_close: %s: immediate\n", f->name);
                   f->refs++;
                   p = f->rproc;
                   if (p)
                           p->ops->eof(p, NULL);
                   p = f->wproc;
                   if (p)
                           p->ops->hup(p, NULL);
                   f->refs--;
                   if (f->state & FILE_ZOMB)
                           file_del(f);
           } else {
                   DPRINTFN(2, "file_close: %s: delayed\n", f->name);
                   f->state &= ~(FILE_ROK | FILE_WOK);
                   f->state |= (FILE_EOF | FILE_HUP);
         }          }
 }  }

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