diff options
author | miwi <miwi@FreeBSD.org> | 2011-02-12 12:55:12 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2011-02-12 12:55:12 +0800 |
commit | 6d45e3d606f2a193c735399996875f474b8fd53a (patch) | |
tree | 5e54552019eceb0f88e94dc03b0e04681675509b | |
parent | 1001ebab8dc04485863833bcb8eb3478b618e5c0 (diff) | |
download | freebsd-ports-gnome-6d45e3d606f2a193c735399996875f474b8fd53a.tar.gz freebsd-ports-gnome-6d45e3d606f2a193c735399996875f474b8fd53a.tar.zst freebsd-ports-gnome-6d45e3d606f2a193c735399996875f474b8fd53a.zip |
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
-rw-r--r-- | sysutils/parallel/Makefile | 1 | ||||
-rw-r--r-- | sysutils/parallel/files/patch-src__parallel | 24 |
2 files changed, 13 insertions, 12 deletions
diff --git a/sysutils/parallel/Makefile b/sysutils/parallel/Makefile index f7475c328088..f082ff17d73a 100644 --- a/sysutils/parallel/Makefile +++ b/sysutils/parallel/Makefile @@ -7,6 +7,7 @@ PORTNAME= parallel PORTVERSION= 20110122 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= GNU 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 |