[BACK]Return to uipc_usrreq.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/kern/uipc_usrreq.c between version 1.39 and 1.40

version 1.39, 1999/03/22 17:54:39 version 1.40, 1999/04/21 02:31:50
Line 916  unp_internalize(control, p)
Line 916  unp_internalize(control, p)
 morespace:  morespace:
         neededspace = (ALIGN(sizeof(*cm)) + nfds * sizeof(struct file *)) -          neededspace = (ALIGN(sizeof(*cm)) + nfds * sizeof(struct file *)) -
                 control->m_len;                  control->m_len;
           if (neededspace)
                   printf("unp_internalize: neededspace=%d\n", neededspace);
         if (neededspace > M_TRAILINGSPACE(control)) {          if (neededspace > M_TRAILINGSPACE(control)) {
   
                 /* if we already have a cluster, the message is just too big */                  /* if we already have a cluster, the message is just too big */
Line 937  morespace:
Line 939  morespace:
         cm->cmsg_len += neededspace;          cm->cmsg_len += neededspace;
         control->m_len = cm->cmsg_len;          control->m_len = cm->cmsg_len;
   
           if (neededspace) {
                   fdp = (int *)(cm + 1);
                   for (i = 0; i < nfds; i++) {
                           fd = *fdp++;
                           if ((unsigned)fd >= fdescp->fd_nfiles ||
                               fdescp->fd_ofiles[fd] == NULL) {
                                   printf("unp_internalize: ERROR DETECTED (1)\n");
                                   return (EBADF);
                           }
                   }
                   if ((cm->cmsg_len / sizeof(struct file *)) != nfds) {
                           printf("unp_internalize: ERROR DETECTED (2)\n");
                           return (EBADF);
                   }
           }
   
         /*          /*
          * Transform the file descriptors into struct file pointers, in           * Transform the file descriptors into struct file pointers, in
          * reverse order so that if pointers are bigger than ints, the           * reverse order so that if pointers are bigger than ints, the

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

CVSweb <webmaster@jp.NetBSD.org>