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

login
register
mail settings
Submitter Stefan Hajnoczi
Date Dec. 6, 2011, 11:01 a.m.
Message ID <1323169274-31657-18-git-send-email-stefanha@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/129624/
State New
Headers show

Comments

Stefan Hajnoczi - Dec. 6, 2011, 11:01 a.m.
From: Peter Maydell <peter.maydell@linaro.org>

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.

Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 linux-user/syscall.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c84cc65..2bf9e7e 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: