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 !
Fix a unit test failure.
Hongli Lai (Phusion) (author)
Sat Apr 19 03:58:14 -0700 2008
commit  d176cb539d42c307a946285bd830380d2d9930f0
tree    64f7e94e6c68cb600ea7443e1afc58e8d1a054ba
parent  3647f801e8072fb82826194ac1e4621a6b19c6ac
...
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
 
 
 
203
204
205
...
187
188
189
 
 
 
 
 
 
 
 
 
 
 
 
 
190
191
192
193
194
195
0
@@ -187,19 +187,9 @@ private:
0
     bool result;
0
     if (stat(restartFile.c_str(), &buf) == 0) {
0
       int ret;
0
- #ifdef TESTING_APPLICATION_POOL
0
- if (getenv("nextRestartTxtDeletionShouldFail") != NULL) {
0
- unsetenv("nextRestartTxtDeletionShouldFail");
0
- ret = -1;
0
- errno = EACCES;
0
- } else {
0
- ret = unlink(restartFile.c_str());
0
- }
0
- #else
0
- do {
0
- ret = unlink(restartFile.c_str());
0
- } while (ret == -1 && errno == EAGAIN);
0
- #endif
0
+ do {
0
+ ret = unlink(restartFile.c_str());
0
+ } while (ret == -1 && errno == EAGAIN);
0
       if (ret == 0 || errno == ENOENT) {
0
         restartFileTimes.erase(appRoot);
0
         result = true;
...
271
272
273
274
275
 
276
277
278
279
 
 
 
 
 
 
 
 
280
281
282
283
284
285
286
287
...
271
272
273
 
 
274
275
276
 
 
277
278
279
280
281
282
283
284
285
 
286
287
 
288
289
290
0
@@ -271,17 +271,20 @@
0
     session1.reset();
0
     session2.reset();
0
     
0
- setenv("nextRestartTxtDeletionShouldFail", "1", 1);
0
- system("touch stub/railsapp/tmp/restart.txt");
0
+ system("mkdir -p stub/railsapp/tmp/restart.txt");
0
     
0
     old_pid = pool->get("stub/railsapp")->getPid();
0
- ensure("Restart file has not been deleted",
0
- stat("stub/railsapp/tmp/restart.txt", &buf) == 0);
0
+ try {
0
+ ensure("Restart file has not been deleted",
0
+ stat("stub/railsapp/tmp/restart.txt", &buf) == 0);
0
+ system("rmdir stub/railsapp/tmp/restart.txt");
0
+ } catch (...) {
0
+ system("rmdir stub/railsapp/tmp/restart.txt");
0
+ throw;
0
+ }
0
     
0
- setenv("nextRestartTxtDeletionShouldFail", "1", 1);
0
     pid = pool->get("stub/railsapp")->getPid();
0
     ensure_equals("The app was not restarted", pid, old_pid);
0
-
0
     unlink("stub/railsapp/tmp/restart.txt");
0
   }
0
   

Comments

    No one has commented yet.