Skip to contentSkip to conversation

linux-user: change do_semop to return target errno when unsuccessful

PATCH Applied Petar Jovanovic 5 participants 7 messages Mar 21, 2013 – Apr 19, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: change do_semop to return target errno when unsuccessful

From: Petar Jovanovic <[email protected]>

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.

---
 linux-user/syscall.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
linux-user/syscall.c +2 -2
index ee82a2d..3c4c155 100644
@@ -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
Signature · 1 line
1.7.9.5
Reviewed-by Peter Maydell
#2 lore raw

ping

http://patchwork.ozlabs.org/patch/229787/

________________________________________
From: Peter Maydell [[email protected]]
Sent: Thursday, March 21, 2013 7:03 PM
To: Petar Jovanovic
Cc: [email protected]; [email protected]; Petar Jovanovic
Subject: Re: [Qemu-devel] [PATCH] linux-user: change do_semop to return target errno when unsuccessful

Quoted 7 lines · Petar Jovanovic

From: Petar Jovanovic <[email protected]>

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.

-- PMM

Reviewed-by Peter Maydell
#3 lore raw

ping
________________________________________
From: Petar Jovanovic
Sent: Monday, April 01, 2013 7:07 PM
To: Peter Maydell; Petar Jovanovic
Cc: [email protected]; [email protected]
Subject: RE: [Qemu-devel] [PATCH] linux-user: change do_semop to return target errno when unsuccessful

ping

http://patchwork.ozlabs.org/patch/229787/

________________________________________
From: Peter Maydell [[email protected]]
Sent: Thursday, March 21, 2013 7:03 PM
To: Petar Jovanovic
Cc: [email protected]; [email protected]; Petar Jovanovic
Subject: Re: [Qemu-devel] [PATCH] linux-user: change do_semop to return target errno when unsuccessful

Quoted 7 lines · Petar Jovanovic

From: Petar Jovanovic <[email protected]>

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.

-- PMM

Reviewed-by Peter Maydell
#4 lore raw

+ [email protected]

ping
________________________________________
From: Petar Jovanovic
Sent: Monday, April 08, 2013 8:31 PM
To: Peter Maydell; Petar Jovanovic
Cc: [email protected]; [email protected]
Subject: RE: [Qemu-devel] [PATCH] linux-user: change do_semop to return target errno when unsuccessful

ping
________________________________________
From: Petar Jovanovic
Sent: Monday, April 01, 2013 7:07 PM
To: Peter Maydell; Petar Jovanovic
Cc: [email protected]; [email protected]
Subject: RE: [Qemu-devel] [PATCH] linux-user: change do_semop to return target errno when unsuccessful

ping

http://patchwork.ozlabs.org/patch/229787/

________________________________________
From: Peter Maydell [[email protected]]
Sent: Thursday, March 21, 2013 7:03 PM
To: Petar Jovanovic
Cc: [email protected]; [email protected]; Petar Jovanovic
Subject: Re: [Qemu-devel] [PATCH] linux-user: change do_semop to return target errno when unsuccessful

Quoted 7 lines · Petar Jovanovic

From: Petar Jovanovic <[email protected]>

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.

-- PMM

#5 lore raw
In reply to Petar Jovanovic
Quoted 10 lines · Petar Jovanovic

From: Petar Jovanovic <[email protected]>

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.

---
 linux-user/syscall.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan

#6 lore raw
Quoted 12 lines · Stefan Hajnoczi
Quoted 10 lines · Petar Jovanovic

From: Petar Jovanovic <[email protected]>

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.

---
 linux-user/syscall.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 4 lines

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Hi,

It's also in my linux-user updates set I'm testing now:

https://git.linaro.org/gitweb?p=people/rikuvoipio/qemu.git;a=shortlog;h=refs/heads/linux-user-for-upstream