Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

When closing file descriptors, do not close internal Ruby VM file des…

…criptors. See ruby-core:37759.
  • Loading branch information...
commit e83d4cf6d0c2272e823d7ba690ee3cbb57a415bf 1 parent 279d68d
Hongli Lai authored August 02, 2011
1  ext/ruby/extconf.rb
@@ -35,6 +35,7 @@
35 35
 
36 36
 have_header('alloca.h')
37 37
 have_header('ruby/io.h')
  38
+have_func('rb_reserved_fd_p')
38 39
 
39 40
 with_cflags($CFLAGS) do
40 41
 	create_makefile('passenger_native_support')
3  ext/ruby/passenger_native_support.c
@@ -276,6 +276,9 @@ close_all_file_descriptors(VALUE self, VALUE exceptions) {
276 276
 	
277 277
 	for (i = sysconf(_SC_OPEN_MAX) - 1; i >= 0; i--) {
278 278
 		int is_exception = 0;
  279
+		#ifdef HAVE_RB_RESERVED_FD_P
  280
+			is_exception = rb_reserved_fd_p(i);
  281
+		#endif
279 282
 		for (j = 0; j < RARRAY_LEN(exceptions) && !is_exception; j++) {
280 283
 			long fd = NUM2INT(rb_ary_entry(exceptions, j));
281 284
 			is_exception = i == fd;

0 notes on commit e83d4cf

Please sign in to comment.
Something went wrong with that request. Please try again.