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 <[email protected]>
Cc: Kirill A. Shutemov <[email protected]>
Cc: Riku Voipio <[email protected]>
Cc: Aurelien Jarno <[email protected]>
Cc: Laurent Vivier <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Signed-off-by: Max Filippov <[email protected]>