public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Search Repo:
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Attempt to fix MacOS X compatibility (again).
Hongli Lai (Phusion) (author)
Tue May 06 12:14:11 -0700 2008
commit  5623d73808a0c8b26229e8de2e782af14764ecdd
tree    1939207d6c9ee5f6874a817d6de5cab79cb7ec28
parent  ca88f5c24a147a04e4f94390ccfced863dfed96c
...
442
443
444
 
445
446
 
447
448
449
...
465
466
467
468
 
469
470
471
...
442
443
444
445
446
447
448
449
450
451
...
467
468
469
 
470
471
472
473
0
@@ -442,8 +442,10 @@
0
         struct cmsghdr header;
0
         int fd;
0
       } control_data;
0
+ #define EXPECTED_CMSG_LEN sizeof(control_data)
0
     #else
0
       char control_data[CMSG_SPACE(sizeof(int))];
0
+ #define EXPECTED_CMSG_LEN CMSG_LEN(sizeof(int))
0
     #endif
0
     struct cmsghdr *control_header;
0
 
0
@@ -465,7 +467,7 @@
0
     }
0
     
0
     control_header = CMSG_FIRSTHDR(&msg);
0
- if (control_header->cmsg_len != CMSG_LEN(sizeof(int))
0
+ if (control_header->cmsg_len != EXPECTED_CMSG_LEN
0
      || control_header->cmsg_level != SOL_SOCKET
0
      || control_header->cmsg_type != SCM_RIGHTS) {
0
       throw IOException("No valid file descriptor received.");
...
110
111
112
 
113
114
 
115
116
117
...
134
135
136
137
 
138
139
140
...
110
111
112
113
114
115
116
117
118
119
...
136
137
138
 
139
140
141
142
0
@@ -110,8 +110,10 @@
0
       struct cmsghdr header;
0
       int fd;
0
     } control_data;
0
+ #define EXPECTED_CMSG_LEN sizeof(control_data)
0
   #else
0
     char control_data[CMSG_SPACE(sizeof(int))];
0
+ #define EXPECTED_CMSG_LEN CMSG_LEN(sizeof(int))
0
   #endif
0
   struct cmsghdr *control_header;
0
 
0
@@ -134,7 +136,7 @@
0
   }
0
   
0
   control_header = CMSG_FIRSTHDR(&msg);
0
- if (control_header->cmsg_len != CMSG_LEN(sizeof(int))
0
+ if (control_header->cmsg_len != EXPECTED_CMSG_LEN
0
    || control_header->cmsg_level != SOL_SOCKET
0
    || control_header->cmsg_type != SCM_RIGHTS) {
0
     rb_sys_fail("No valid file descriptor received.");

Comments

    No one has commented yet.