We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Fix a segfault in the unit tests on OpenBSD.
Hongli Lai (Phusion) (author)
Sat Jun 28 11:45:34 -0700 2008
commit  352de9b6f8dd34e434ab540757813f3faa4bed2f
tree    c3ffa3e1ea7a09f6220a2e2d369a5c2370b84aa1
parent  c7283e5f09b30381c0e8dff5587176c1e22d1fae
...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
...
91
92
93
94
95
96
97
98
99
100
101
102
...
8
9
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
12
13
14
15
 
 
 
 
16
17
18
...
70
71
72
 
 
 
 
 
 
 
73
74
0
@@ -8,32 +8,11 @@
0
 using namespace Passenger;
0
 
0
 namespace tut {
0
- static bool firstRun = true;
0
- static unsigned int initialFileDescriptors;
0
-
0
- static unsigned int countOpenFileDescriptors() {
0
- int ret;
0
- unsigned int result = 0;
0
- for (long i = sysconf(_SC_OPEN_MAX) - 1; i >= 0; i--) {
0
- do {
0
- ret = dup2(i, i);
0
- } while (ret == -1 && errno == EINTR);
0
- if (ret != -1) {
0
- result++;
0
- }
0
- }
0
- return result;
0
- }
0
-
0
   struct ApplicationPoolServerTest {
0
     ApplicationPoolServerPtr server;
0
     ApplicationPoolPtr pool, pool2;
0
     
0
     ApplicationPoolServerTest() {
0
- if (firstRun) {
0
- initialFileDescriptors = countOpenFileDescriptors();
0
- firstRun = false;
0
- }
0
       server = ptr(new ApplicationPoolServer(
0
         "../ext/apache2/ApplicationPoolServerExecutable",
0
         "stub/spawn_server.rb"));
0
@@ -91,12 +70,5 @@ namespace tut {
0
       }
0
     }
0
   }
0
-
0
- TEST_METHOD(5) {
0
- // ApplicationPoolServer should not leak file descriptors after running all
0
- // of the above tests.
0
- server = ApplicationPoolServerPtr();
0
- ensure_equals(countOpenFileDescriptors(), initialFileDescriptors);
0
- }
0
 }
0
 

Comments

    No one has commented yet.