Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4A93F200B6B for ; Thu, 25 Aug 2016 13:55:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 42610160A94; Thu, 25 Aug 2016 11:54:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 89B89160A93 for ; Thu, 25 Aug 2016 13:54:56 +0200 (CEST) Received: (qmail 19860 invoked by uid 500); 25 Aug 2016 11:54:55 -0000 Mailing-List: contact commits-help@hawq.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hawq.incubator.apache.org Delivered-To: mailing list commits@hawq.incubator.apache.org Received: (qmail 19851 invoked by uid 99); 25 Aug 2016 11:54:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2016 11:54:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3BF191804D2 for ; Thu, 25 Aug 2016 11:54:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id NO2GI2jHzg7J for ; Thu, 25 Aug 2016 11:54:54 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 256AC5F30B for ; Thu, 25 Aug 2016 11:54:52 +0000 (UTC) Received: (qmail 19821 invoked by uid 99); 25 Aug 2016 11:54:52 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2016 11:54:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E70E8E01BD; Thu, 25 Aug 2016 11:54:51 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: huor@apache.org To: commits@hawq.incubator.apache.org Message-Id: <792765fb8c7c487eb7ef965f5f3c51f2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-hawq git commit: HAWQ-1022. Bugfix for getCommandOutput: using reference to temporary variable in stack address. Date: Thu, 25 Aug 2016 11:54:51 +0000 (UTC) archived-at: Thu, 25 Aug 2016 11:55:12 -0000 Repository: incubator-hawq Updated Branches: refs/heads/master 48c34ca64 -> b13ca83bf HAWQ-1022. Bugfix for getCommandOutput: using reference to temporary variable in stack address. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/b13ca83b Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/b13ca83b Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/b13ca83b Branch: refs/heads/master Commit: b13ca83bf3d065265f3129edd318a226cd9f9687 Parents: 48c34ca Author: xunzhang Authored: Thu Aug 25 18:24:52 2016 +0800 Committer: xunzhang Committed: Thu Aug 25 19:04:04 2016 +0800 ---------------------------------------------------------------------- src/test/feature/lib/command.cpp | 4 ++-- src/test/feature/lib/command.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b13ca83b/src/test/feature/lib/command.cpp ---------------------------------------------------------------------- diff --git a/src/test/feature/lib/command.cpp b/src/test/feature/lib/command.cpp index d46aaf0..7f5f34a 100644 --- a/src/test/feature/lib/command.cpp +++ b/src/test/feature/lib/command.cpp @@ -73,14 +73,14 @@ void Command::_saveToFile() { out.close(); } -const string& Command::getCommandOutput(const string& cmd) { +const string Command::getCommandOutput(const string& cmd) { return Command() .setCommand(cmd) .run() .getResultOutput(); } -const string& Command::getCommandOutput(const string& cmd, +const string Command::getCommandOutput(const string& cmd, const string& out) { return Command() .setCommand(cmd) http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b13ca83b/src/test/feature/lib/command.h ---------------------------------------------------------------------- diff --git a/src/test/feature/lib/command.h b/src/test/feature/lib/command.h index 931b3bc..e0ae97f 100644 --- a/src/test/feature/lib/command.h +++ b/src/test/feature/lib/command.h @@ -18,12 +18,12 @@ class Command { Command& run(); Command& setCommand(const std::string&); Command& setOutputFile(const std::string&); - const std::string& getCommand() const; - const std::string& getResultOutput() const; + const std::string& getCommand() const; + const std::string& getResultOutput() const; int getResultStatus() const; - static const std::string& getCommandOutput(const std::string& cmd); - static const std::string& getCommandOutput(const std::string& cmd, const std::string& out); + static const std::string getCommandOutput(const std::string& cmd); + static const std::string getCommandOutput(const std::string& cmd, const std::string& out); static int getCommandStatus(const std::string& cmd); static int getCommandStatus(const std::string& cmd, const std::string& out);