Skip to contentSkip to conversation

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

PATCH Applied Peter Maydell 3 participants 3 messages Dec 5, 2011 – Dec 6, 2011

lore
Share & tools
lore
#0 lore raw

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

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.

---
Alex Graf spotted this one...

 linux-user/syscall.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
linux-user/syscall.c +4 -2
index f227097..4846b41 100644
@@ -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:
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Peter Maydell

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.

Alex

Quoted 26 lines

---
Alex Graf spotted this one...

linux-user/syscall.c | 6 ++++--

1 files changed, 4 insertions(+), 2 deletions(-)
linux-user/syscall.c +4 -2
index f227097..4846b41 100644
@@ -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:
Signature · 1 line
1.7.5.4
#2 lore raw
In reply to Peter Maydell
Quoted 10 lines · Peter Maydell

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.

---
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