From patchwork Wed Jun 8 13:30:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 69661 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2520401qgf; Wed, 8 Jun 2016 07:16:45 -0700 (PDT) X-Received: by 10.200.53.39 with SMTP id y36mr4846625qtb.92.1465395405342; Wed, 08 Jun 2016 07:16:45 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l132si778220qhc.62.2016.06.08.07.16.45 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 08 Jun 2016 07:16:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAeHk-0004Iq-Ni for patch@linaro.org; Wed, 08 Jun 2016 10:16:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZo-0004fz-CB for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAdZn-0005to-Bw for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:20 -0400 Received: from mail-lf0-x232.google.com ([2a00:1450:4010:c07::232]:34041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZn-0005tP-51 for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:19 -0400 Received: by mail-lf0-x232.google.com with SMTP id s186so5881852lfs.1 for ; Wed, 08 Jun 2016 06:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AKRkecmevRl/HZdKNbFXS1UxbiLm0zeS2JoZtioOhmQ=; b=GLpnzfMn5twteTw96XhY/htrHH6Z5GXyG82rwC4QC6GkSs76yLP0pFvbNFdv4wfXiw yx4P12BNtbHQG8yLXxL2Lg/g46nMDRGmNM1AAdO+3mvmcfqqRni9lUOrYJitRuvCsxf0 sV3EmqIYEMRjP0wWhW9UyHNv32U2ewofHrTGo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AKRkecmevRl/HZdKNbFXS1UxbiLm0zeS2JoZtioOhmQ=; b=S7/dWMSOeL8COG0EXgVjabJy+uLD19dbHphEJxK5giFRvtOc134cgN3Dz5ESAiwieT jH5DLwlaOQyvb16D4pQpfEhcEeQXHbrV/Pm8ggJke/uls22JYjfW6lmnAIuIt/cxO6Uj p1QrYa5HGP5mwwWVX9e++98IS4+ad69Cq5feALS2QQoT6AHlDn2PrYfQ8UANH9vAJMf1 ilw52A8Fo2RFJ9dazjbukUfGW0ECLjZq2FufpBh/F1pGilcuybTK3cLjGbVD+9vWSbKu xFhHvJYIPJXE7mPuNEsVo8fNFZHxrfLbaXS8fLArhUjKA6za4HzBGTtr2E72Msrbtqei fAZA== X-Gm-Message-State: ALyK8tKxEb2S3kACBXo6NepmJ2EPbKBW7m5GUw+azXVrEDjwH38uPJ5Kl9eN0Lv/81SuP41y X-Received: by 10.46.71.14 with SMTP id u14mr1378712lja.19.1465392678486; Wed, 08 Jun 2016 06:31:18 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id 2sm139854lja.37.2016.06.08.06.31.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 06:31:17 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 8 Jun 2016 16:30:23 +0300 Message-Id: <7dcdaeafe07dd87079c4e073bced4cfc8bf5fdf3.1465392531.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::232 Subject: [Qemu-devel] [PULL 42/44] linux-user: Make target_strerror() return 'const char *' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Make target_strerror() return 'const char *' rather than just 'char *'; this will allow us to return constant strings from it for some special cases. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio Reviewed-by: Laurent Vivier --- linux-user/qemu.h | 2 +- linux-user/strace.c | 4 ++-- linux-user/syscall.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) -- 2.1.4 diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 6bd7b32..56f29c3 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -195,7 +195,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2); extern THREAD CPUState *thread_cpu; void cpu_loop(CPUArchState *env); -char *target_strerror(int err); +const char *target_strerror(int err); int get_osversion(void); void init_qemu_uname_release(void); void fork_start(void); diff --git a/linux-user/strace.c b/linux-user/strace.c index 0810c85..c5980a1 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -281,7 +281,7 @@ print_ipc(const struct syscallname *name, static void print_syscall_ret_addr(const struct syscallname *name, abi_long ret) { - char *errstr = NULL; + const char *errstr = NULL; if (ret < 0) { errstr = target_strerror(-ret); @@ -1594,7 +1594,7 @@ void print_syscall_ret(int num, abi_long ret) { int i; - char *errstr = NULL; + const char *errstr = NULL; for(i=0;i= (abi_ulong)(-4096); } -char *target_strerror(int err) +const char *target_strerror(int err) { if ((err >= ERRNO_TABLE_SIZE) || (err < 0)) { return NULL;