[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/8] linux-user: change do_semop to return target er
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 5/8] linux-user: change do_semop to return target errno when unsuccessful |
Date: |
Fri, 19 Apr 2013 13:33:58 +0200 |
From: Petar Jovanovic <address@hidden>
do_semop() is called from two places, and one of these fails to convert
return error to target errno when semop fails. This patch changes the
function to always return target errno in case of an unsuccessful call.
Signed-off-by: Petar Jovanovic <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
linux-user/syscall.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1f07621..d6d2050 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2764,7 +2764,7 @@ static inline abi_long do_semop(int semid, abi_long ptr,
unsigned nsops)
if (target_to_host_sembuf(sops, ptr, nsops))
return -TARGET_EFAULT;
- return semop(semid, sops, nsops);
+ return get_errno(semop(semid, sops, nsops));
}
struct target_msqid_ds
@@ -6957,7 +6957,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#endif
#ifdef TARGET_NR_semop
case TARGET_NR_semop:
- ret = get_errno(do_semop(arg1, arg2, arg3));
+ ret = do_semop(arg1, arg2, arg3);
break;
#endif
#ifdef TARGET_NR_semctl
--
1.8.1.4
- [Qemu-devel] [PULL 0/8] Trivial patches for 13 to 19 April 2013, Stefan Hajnoczi, 2013/04/19
- [Qemu-devel] [PATCH 1/8] bswap: fix compiler warning, Stefan Hajnoczi, 2013/04/19
- [Qemu-devel] [PATCH 2/8] virtio.h: drop unused function prototypes, Stefan Hajnoczi, 2013/04/19
- [Qemu-devel] [PATCH 4/8] w64: Fix compiler warnings (wrong format specifier), Stefan Hajnoczi, 2013/04/19
- [Qemu-devel] [PATCH 3/8] Remove unneeded type casts, Stefan Hajnoczi, 2013/04/19
- [Qemu-devel] [PATCH 6/8] block/ssh: Add missing gcc format attributes, Stefan Hajnoczi, 2013/04/19
- [Qemu-devel] [PATCH 5/8] linux-user: change do_semop to return target errno when unsuccessful,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 8/8] m25p80: Remove bogus include of devices.h, Stefan Hajnoczi, 2013/04/19
- [Qemu-devel] [PATCH 7/8] ssh: Remove unnecessary use of strlen function., Stefan Hajnoczi, 2013/04/19