]> git.proxmox.com Git - mirror_qemu.git/commit - linux-user/syscall.c
linux-user: fix mq_getsetattr implementation
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 31 Mar 2018 15:20:15 +0000 (08:20 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Sat, 31 Mar 2018 21:06:36 +0000 (14:06 -0700)
commita23ea409824afb9bce3a4d54881310757811c218
tree856bd6570aec3eeb9560f9212bf605886c2a1515
parent73a988d957b9142e0a005f4dc87944574f02de51
linux-user: fix mq_getsetattr implementation

mq_getsetattr implementation does not set errno correctly in case of
error. Also in the presence of both 2nd and 3rd arguments it calls both
mq_getattr and mq_setattr, whereas only the latter call would suffice.

Don't call mq_getattr in the presence of the 2nd argument. Don't copy
output back to user in case of error. Use get_errno to set errno value.

This fixes test rt/tst-mqueue2 from the glibc testsuite.

Cc: Lionel Landwerlin <lionel.landwerlin@openwide.fr>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
linux-user/syscall.c