[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 04/04: L::I::FrontendUtil: Use safe_qx to replace qx() call



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 1f9f6729eced73d6f48ae1ca84fd15b8df1f72aa
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Sep 14 13:09:22 2014 +0200

    L::I::FrontendUtil: Use safe_qx to replace qx() call
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 lib/Lintian/Internal/FrontendUtil.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/Lintian/Internal/FrontendUtil.pm b/lib/Lintian/Internal/FrontendUtil.pm
index a4ca0f9..1157a83 100644
--- a/lib/Lintian/Internal/FrontendUtil.pm
+++ b/lib/Lintian/Internal/FrontendUtil.pm
@@ -26,6 +26,7 @@ use Exporter qw(import);
 use Dpkg::Vendor;
 
 use Lintian::CollScript;
+use Lintian::Command qw(safe_qx);
 use Lintian::Util qw(check_path fail);
 
 our @EXPORT_OK
@@ -84,8 +85,8 @@ sub load_collections {
 # Return the default number of parallization to be used
 sub default_parallel {
     # check cpuinfo for the number of cores...
-    my $cpus;
-    chomp($cpus = `nproc 2>&1`);
+    my %opts = ('err' => '&1');
+    my $cpus = safe_qx(['nproc']);
     if ($? == 0 and $cpus =~ m/^\d+$/) {
         # Running up to twice the number of cores usually gets the most out
         # of the CPUs and disks but it might be too aggresive to be the

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: