qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: patches@linaro.org, Riku Voipio <riku.voipio@iki.fi>
Subject: Re: [Qemu-devel] [PATCH 17/18] linux-user: Make target_strerror() return 'const char *'
Date: Tue, 7 Jun 2016 21:56:18 +0200	[thread overview]
Message-ID: <aaf2bc1d-4afb-101a-b2d6-349da7bde4a5@vivier.eu> (raw)
In-Reply-To: <1465239499-5048-18-git-send-email-peter.maydell@linaro.org>



Le 06/06/2016 à 20:58, Peter Maydell a écrit :
> 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 <peter.maydell@linaro.org>

Reviewed-by: Laurent Vivier <laurent@vivier.eu>

> ---
>  linux-user/qemu.h    | 2 +-
>  linux-user/strace.c  | 4 ++--
>  linux-user/syscall.c | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> 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<nsyscalls;i++)
>          if( scnames[i].nr == num ) {
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 249d246..bcee02d 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -617,7 +617,7 @@ static inline int is_error(abi_long ret)
>      return (abi_ulong)ret >= (abi_ulong)(-4096);
>  }
>  
> -char *target_strerror(int err)
> +const char *target_strerror(int err)
>  {
>      if ((err >= ERRNO_TABLE_SIZE) || (err < 0)) {
>          return NULL;
> 

  reply	other threads:[~2016-06-07 19:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 18:58 [Qemu-devel] [PATCH 00/18] linux-user: Extend safe_syscall wrapper use Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 01/18] linux-user: Use safe_syscall wrapper for readv and writev syscalls Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 02/18] linux-user: Use safe_syscall wrapper for connect syscall Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 03/18] linux-user: Use safe_syscall wrapper for send* and recv* syscalls Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 04/18] linux-user: Use safe_syscall wrapper for msgsnd and msgrcv Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 05/18] linux-user: Use safe_syscall wrapper for mq_timedsend and mq_timedreceive Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 06/18] linux-user: Use safe_syscall wrapper for flock Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 07/18] linux-user: Use safe_syscall wrapper for rt_sigtimedwait syscall Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 08/18] linux-user: Use safe_syscall wrapper for sleep syscalls Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 09/18] linux-user: Use safe_syscall wrapper for poll and ppoll syscalls Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 10/18] linux-user: Use safe_syscall wrapper for epoll_wait syscalls Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 11/18] linux-user: Use safe_syscall wrapper for semop Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 12/18] linux-user: Use safe_syscall wrapper for accept and accept4 syscalls Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 13/18] linux-user: Use safe_syscall wrapper for ioctl Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 14/18] linux-user: Use __get_user() and __put_user() to handle structs in do_fcntl() Peter Maydell
2016-06-07 20:41   ` Laurent Vivier
2016-06-07 21:20     ` Peter Maydell
2016-06-08  9:33       ` Laurent Vivier
2016-06-06 18:58 ` [Qemu-devel] [PATCH 15/18] linux-user: Correct signedness of target_flock l_start and l_len fields Peter Maydell
2016-06-07 20:00   ` Laurent Vivier
2016-06-06 18:58 ` [Qemu-devel] [PATCH 16/18] linux-user: Use safe_syscall wrapper for fcntl Peter Maydell
2016-06-06 18:58 ` [Qemu-devel] [PATCH 17/18] linux-user: Make target_strerror() return 'const char *' Peter Maydell
2016-06-07 19:56   ` Laurent Vivier [this message]
2016-06-06 18:58 ` [Qemu-devel] [PATCH 18/18] linux-user: Special-case ERESTARTSYS in target_strerror() Peter Maydell
2016-06-07 19:53   ` Laurent Vivier
2016-06-07 21:31     ` Peter Maydell
2016-06-08  9:20 ` [Qemu-devel] [PATCH 00/18] linux-user: Extend safe_syscall wrapper use Riku Voipio
2016-06-08 11:26   ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aaf2bc1d-4afb-101a-b2d6-349da7bde4a5@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).