aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2013-04-20 11:38:29 +0000
committerBlue Swirl <blauwirbel@gmail.com>2013-04-20 11:38:29 +0000
commit87885c8e57db38669dad2aa1a83577fe95f481be (patch)
tree78cdcd1dd1d67c9c14dff4198450486ebd2577ce
parentf691df528340807d42247fe79a89ea88e6303e1d (diff)
parent03903ffcfb5a7c75e52da97d00eb9d0bb0660f28 (diff)
Merge branch 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu
* 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu: linux-user: fix setgroups/getgroups for non-UID16 archs linux-user: fix undefined shift in copy_to_user_fdset linux-user: change do_semop to return target errno when unsuccessful
-rw-r--r--linux-user/syscall.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d6d20502ed..c705960d7e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -914,7 +914,7 @@ static inline abi_long copy_to_user_fdset(abi_ulong target_fds_addr,
for (i = 0; i < nw; i++) {
v = 0;
for (j = 0; j < TARGET_ABI_BITS; j++) {
- v |= ((FD_ISSET(k, fds) != 0) << j);
+ v |= ((abi_ulong)(FD_ISSET(k, fds) != 0) << j);
k++;
}
__put_user(v, &target_fds[i]);
@@ -7743,12 +7743,12 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
if (gidsetsize == 0)
break;
if (!is_error(ret)) {
- target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * 2, 0);
+ target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * sizeof(target_id), 0);
if (!target_grouplist)
goto efault;
for(i = 0;i < ret; i++)
target_grouplist[i] = tswapid(high2lowgid(grouplist[i]));
- unlock_user(target_grouplist, arg2, gidsetsize * 2);
+ unlock_user(target_grouplist, arg2, gidsetsize * sizeof(target_id));
}
}
break;
@@ -7760,7 +7760,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
int i;
if (gidsetsize) {
grouplist = alloca(gidsetsize * sizeof(gid_t));
- target_grouplist = lock_user(VERIFY_READ, arg2, gidsetsize * 2, 1);
+ target_grouplist = lock_user(VERIFY_READ, arg2, gidsetsize * sizeof(target_id), 1);
if (!target_grouplist) {
ret = -TARGET_EFAULT;
goto fail;