From: riku.voipio@linaro.org
To: qemu-devel@nongnu.org
Cc: Petar Jovanovic <petar.jovanovic@imgtec.com>
Subject: [Qemu-devel] [PATCH 1/3] linux-user: change do_semop to return target errno when unsuccessful
Date: Fri, 19 Apr 2013 16:59:54 +0300 [thread overview]
Message-ID: <c7128c9fd58ee92cae70c7cd1d53acc529cebbbb.1366377671.git.riku.voipio@linaro.org> (raw)
In-Reply-To: <cover.1366377671.git.riku.voipio@linaro.org>
From: Petar Jovanovic <petar.jovanovic@imgtec.com>
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 <petar.jovanovic@imgtec.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
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.7.10.4
next prev parent reply other threads:[~2013-04-19 14:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-19 13:59 [Qemu-devel] [PULL] [PATCH 0/3] linux-user pending patches riku.voipio
2013-04-19 13:59 ` riku.voipio [this message]
2013-04-19 13:59 ` [Qemu-devel] [PATCH 2/3] linux-user: fix undefined shift in copy_to_user_fdset riku.voipio
2013-04-19 13:59 ` [Qemu-devel] [PATCH 3/3] linux-user: fix setgroups/getgroups for non-UID16 archs riku.voipio
2013-04-20 12:38 ` [Qemu-devel] [PULL] [PATCH 0/3] linux-user pending patches Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c7128c9fd58ee92cae70c7cd1d53acc529cebbbb.1366377671.git.riku.voipio@linaro.org \
--to=riku.voipio@linaro.org \
--cc=petar.jovanovic@imgtec.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).