diff options
author | Martin Wilke <miwi@FreeBSD.org> | 2011-02-12 04:55:12 +0000 |
---|---|---|
committer | Martin Wilke <miwi@FreeBSD.org> | 2011-02-12 04:55:12 +0000 |
commit | 59b17e6ffff003a51e226c6f053c005aa8d1d442 (patch) | |
tree | 3c227d4895edf1b26bfd4b1c990bc064ff448bbb /sysutils/parallel/files/patch-src__parallel | |
parent | hostapd is a user space daemon for access point and authentication (diff) |
The previous patch I made alters a function to call "getconf ARG_MAX" to get the
maximum command line length. However I failed to realize that the rest of the
program called this function a lot. I have now altered the patch file to call
getconf once on program run instead of multiple times, greatly reducing
execution time.
PR: 154560
Submitted by: maintainer
Notes
Notes:
svn path=/head/; revision=268965
Diffstat (limited to 'sysutils/parallel/files/patch-src__parallel')
-rw-r--r-- | sysutils/parallel/files/patch-src__parallel | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sysutils/parallel/files/patch-src__parallel b/sysutils/parallel/files/patch-src__parallel index 6c1d80e25855..6d460db6b7f2 100644 --- a/sysutils/parallel/files/patch-src__parallel +++ b/sysutils/parallel/files/patch-src__parallel @@ -1,5 +1,5 @@ --- ./src/parallel.orig 2011-01-22 15:37:41.000000000 -0700 -+++ ./src/parallel 2011-01-30 11:39:53.000000000 -0700 ++++ ./src/parallel 2011-02-06 14:56:46.000000000 -0700 @@ -2077,14 +2077,20 @@ sub no_of_cpus_freebsd { # Returns: @@ -23,14 +23,15 @@ return $no_of_cores; } -@@ -3455,28 +3461,40 @@ +@@ -3455,28 +3461,42 @@ # Maximal command line length (for -m and -X) sub max_length { - # Find the max_length of a command line - # Returns: - # number of chars on the longest command line allowed -- if(not $Limits::Command::line_max_len) { ++ # FreeBSD code: + if(not $Limits::Command::line_max_len) { - if($::opt_s) { - if(is_acceptable_command_line_length($::opt_s)) { - $Limits::Command::line_max_len = $::opt_s; @@ -47,17 +48,16 @@ - } else { - $Limits::Command::line_max_len = real_max_length(); - } -+ # FreeBSD code: -+ my $limit = `getconf ARG_MAX` - 1024; -+ if ($::opt_s) { -+ if ($::opt_s > $limit) { -+ print STDERR "$Global::progname: ", -+ "you are setting value for -s greater than $limit\n"; ++ $Limits::Command::line_max_len = `getconf ARG_MAX` - 1024; ++ if ($::opt_s) { ++ if ($::opt_s > $Limits::Command::line_max_len) { ++ print STDERR "$Global::progname: ", ++ "you are setting value for -s greater than $Limits::Command::line_max_len\n"; ++ } ++ $Limits::Command::line_max_len = $::opt_s; + } -+ $limit = $::opt_s; } -- return $Limits::Command::line_max_len; -+ return $limit; + return $Limits::Command::line_max_len; + +# ORIGINAL code: +# # Find the max_length of a command line |