Lines 1-28
Link Here
|
1 |
--- ./src/parallel.orig 2012-08-22 21:25:08.000000000 -0500 |
1 |
--- ./src/parallel.orig 2012-12-22 14:56:17.000000000 -0600 |
2 |
+++ ./src/parallel 2012-08-22 21:25:24.000000000 -0500 |
2 |
+++ ./src/parallel 2012-12-22 14:58:55.000000000 -0600 |
3 |
@@ -4571,21 +4571,15 @@ |
3 |
@@ -4790,29 +4790,19 @@ |
4 |
# Returns: |
4 |
package Limits::Command; |
5 |
# number of chars on the longest command line allowed |
5 |
|
6 |
if(not $Limits::Command::line_max_len) { |
6 |
# Maximal command line length (for -m and -X) |
7 |
+ $Limits::Command::line_max_len = `getconf ARG_MAX` - 1024; |
7 |
-sub max_length { |
8 |
if($::opt_s) { |
8 |
- # Find the max_length of a command line and cache it |
9 |
- if(is_acceptable_command_line_length($::opt_s)) { |
9 |
- # Returns: |
10 |
- $Limits::Command::line_max_len = $::opt_s; |
10 |
- # number of chars on the longest command line allowed |
|
|
11 |
- if(not $Limits::Command::line_max_len) { |
12 |
- if($opt::s) { |
13 |
- if(is_acceptable_command_line_length($opt::s)) { |
14 |
- $Limits::Command::line_max_len = $opt::s; |
11 |
- } else { |
15 |
- } else { |
12 |
- # -s is too long: Find the correct |
16 |
- # -s is too long: Find the correct |
13 |
- $Limits::Command::line_max_len = binary_find_max_length(0,$::opt_s); |
17 |
- $Limits::Command::line_max_len = binary_find_max_length(0,$opt::s); |
14 |
+ if($::opt_s > $Limits::Command::line_max_len) { |
18 |
- } |
15 |
+ print STDERR "$Global::progname: ", |
19 |
- if($opt::s <= $Limits::Command::line_max_len) { |
16 |
+ "you are setting value for -s greater than $Limits::Command::line_max_len\n"; |
20 |
- $Limits::Command::line_max_len = $opt::s; |
17 |
} |
|
|
18 |
if($::opt_s <= $Limits::Command::line_max_len) { |
19 |
$Limits::Command::line_max_len = $::opt_s; |
20 |
- } else { |
21 |
- } else { |
21 |
- ::warning("Value for -s option ", |
22 |
- ::warning("Value for -s option ", |
22 |
- "should be < $Limits::Command::line_max_len.\n"); |
23 |
- "should be < $Limits::Command::line_max_len.\n"); |
23 |
} |
24 |
- } |
24 |
- } else { |
25 |
- } else { |
25 |
- $Limits::Command::line_max_len = real_max_length(); |
26 |
- $Limits::Command::line_max_len = real_max_length(); |
26 |
} |
27 |
- } |
27 |
} |
28 |
- } |
28 |
return $Limits::Command::line_max_len; |
29 |
- return $Limits::Command::line_max_len; |
|
|
30 |
+sub max_length { |
31 |
+ # FreeBSD code: |
32 |
+ if(not $Limits::Command::line_max_len) { |
33 |
+ $Limits::Command::line_max_len = `getconf ARG_MAX` - 1024; |
34 |
+ if ($opt::s) { |
35 |
+ if ($opt::s > $Limits::Command::line_max_len) { |
36 |
+ print STDERR "$Global::progname: ", |
37 |
+ "you are setting value for -s greater than $Limits::Command::line_max_len\n"; |
38 |
+ } |
39 |
+ $Limits::Command::line_max_len = $opt::s; |
40 |
+ } |
41 |
+ } |
42 |
+ return $Limits::Command::line_max_len; |
43 |
} |
44 |
|
45 |
sub real_max_length { |