(file) Return to Socket.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Executor

Diff for /pegasus/src/Executor/Socket.h between version 1.1.2.6 and 1.1.2.7

version 1.1.2.6, 2007/01/17 21:32:26 version 1.1.2.7, 2007/01/17 22:12:13
Line 42 
Line 42 
 #include "Defines.h" #include "Defines.h"
 #include <sys/socket.h> #include <sys/socket.h>
 #include <string.h> #include <string.h>
   #include "Defines.h"
  
 EXECUTOR_LINKAGE EXECUTOR_LINKAGE
 int SetNonBlocking(int sock); int SetNonBlocking(int sock);
Line 66 
Line 67 
  
 static int RecvDescriptorArray(int sock, int descriptors[], size_t count) static int RecvDescriptorArray(int sock, int descriptors[], size_t count)
 { {
     struct msghdr mh;  
     size_t size;  
     char* data;  
     struct iovec iov[1];     struct iovec iov[1];
     char dummy;     char dummy;
       struct msghdr mh;
     ssize_t n;     ssize_t n;
   #if defined(HAVE_MSG_CONTROL)
       size_t size;
       char* data;
     struct cmsghdr* cmh = CMSG_FIRSTHDR(&mh);     struct cmsghdr* cmh = CMSG_FIRSTHDR(&mh);
  
     /*     /*
Line 95 
Line 97 
     mh.msg_control = data;     mh.msg_control = data;
     mh.msg_controllen = size;     mh.msg_controllen = size;
  
   #else /* !defined(HAVE_MSG_CONTROL) */
   
       mh.msg_accrights = (caddr_t)descriptors;
       mh.msg_accrightslength = sizeof(int) * count;
   
   #endif /* defined(HAVE_MSG_CONTROL) */
   
     /*     /*
      * The other process sends a single-byte message. This byte is not      * The other process sends a single-byte message. This byte is not
      * used since we only need the control data (the descriptor) but we      * used since we only need the control data (the descriptor) but we
Line 119 
Line 128 
      * does not contain what we expect.      * does not contain what we expect.
      */      */
  
   #if defined(HAVE_MSG_CONTROL)
   
     cmh = CMSG_FIRSTHDR(&mh);     cmh = CMSG_FIRSTHDR(&mh);
  
     if (!cmh ||     if (!cmh ||
Line 133 
Line 144 
  
     memcpy(descriptors, CMSG_DATA(cmh), sizeof(int) * count);     memcpy(descriptors, CMSG_DATA(cmh), sizeof(int) * count);
  
   #else /* !defined(HAVE_MSG_CONTROL) */
   
       if (mh.msg_accrightslength != sizeof(int) * count)
           return -1;
   
       memcpy(descriptors, mh.msg_accrights, sizeof(int) * count);
   
   #endif /* defined(HAVE_MSG_CONTROL) */
   
     return 0;     return 0;
 } }
  


Legend:
Removed from v.1.1.2.6  
changed lines
  Added in v.1.1.2.7

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2