File: 0100_run_builtin_shell_command_ulimit_in_tests.patch

package info (click to toggle)
ruby-libxml 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,812 kB
  • sloc: xml: 9,628; ruby: 7,119; ansic: 6,665; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 812 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: run correctly the built-in command "ulimit"
 ulimit is a built-in shell command and cannot be simply called from ruby with
 backticks. Passing the command as a string to sh with the -c switch seems to be
 the correct way to do this.
Author: Cédric Boutillier <cedric.boutillier@gmail.com>
Last-Update:2011-11-26

--- a/test/tc_parser.rb
+++ b/test/tc_parser.rb
@@ -246,7 +246,7 @@
     max_fd = if RUBY_PLATFORM.match(/mswin32|mingw/i)
       500
     else
-      (`ulimit -n`.chomp.to_i) + 1
+      (`sh -c "ulimit -n"`.chomp.to_i) + 1
     end
 
     file = File.join(File.dirname(__FILE__), 'model/rubynet.xml')
@@ -353,4 +353,4 @@
     assert_instance_of(XML::Document, doc)
     assert_instance_of(XML::Parser::Context, parser.context)
   end
-end
\ No newline at end of file
+end