Patchwork linux-user/syscall.c: Don't skip stracing for fcntl64 failure case

login
register
mail settings
Submitter Peter Maydell
Date Dec. 5, 2011, 11:11 p.m.
Message ID <1323126710-2242-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/129464/
State New
Headers show

Comments

Peter Maydell - Dec. 5, 2011, 11:11 p.m.
In an fcntl64 failure path, we were returning directly rather than
simply breaking out of the switch statement. This skips the strace
code for printing the syscall return value, so don't do that.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Alex Graf spotted this one...

 linux-user/syscall.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
Alexander Graf - Dec. 5, 2011, 11:34 p.m.
On 06.12.2011, at 00:11, Peter Maydell wrote:

> In an fcntl64 failure path, we were returning directly rather than
> simply breaking out of the switch statement. This skips the strace
> code for printing the syscall return value, so don't do that.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Acked-by: Alexander Graf <agraf@suse.de>


Alex

> ---
> Alex Graf spotted this one...
> 
> linux-user/syscall.c |    6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index f227097..4846b41 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -7521,8 +7521,10 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
> #endif
> 
> 	cmd = target_to_host_fcntl_cmd(arg2);
> -	if (cmd == -TARGET_EINVAL)
> -		return cmd;
> +        if (cmd == -TARGET_EINVAL) {
> +            ret = cmd;
> +            break;
> +        }
> 
>         switch(arg2) {
>         case TARGET_F_GETLK64:
> -- 
> 1.7.5.4
>
Stefan Hajnoczi - Dec. 6, 2011, 10:45 a.m.
On Mon, Dec 05, 2011 at 11:11:50PM +0000, Peter Maydell wrote:
> In an fcntl64 failure path, we were returning directly rather than
> simply breaking out of the switch statement. This skips the strace
> code for printing the syscall return value, so don't do that.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Alex Graf spotted this one...
> 
>  linux-user/syscall.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)

Thanks, applied to the trivial patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Stefan

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f227097..4846b41 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7521,8 +7521,10 @@  abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
 #endif
 
 	cmd = target_to_host_fcntl_cmd(arg2);
-	if (cmd == -TARGET_EINVAL)
-		return cmd;
+        if (cmd == -TARGET_EINVAL) {
+            ret = cmd;
+            break;
+        }
 
         switch(arg2) {
         case TARGET_F_GETLK64: