Le 31/03/2018 à 18:57, Laurent Vivier a écrit : > Le 31/03/2018 à 18:23, Max Filippov a écrit : >> 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 3rd argument. Use get_errno >> to set errno value. >> >> This fixes test rt/tst-mqueue2 from the glibc testsuite. >> >> Cc: Lionel Landwerlin <lionel.landwer...@openwide.fr> >> Cc: Kirill A. Shutemov <kirill.shute...@linux.intel.com> >> Cc: Riku Voipio <riku.voi...@iki.fi> >> Cc: Aurelien Jarno <aurel...@aurel32.net> >> Cc: Laurent Vivier <laur...@vivier.eu> >> Signed-off-by: Max Filippov <jcmvb...@gmail.com> >> --- >> linux-user/syscall.c | 13 +++++++------ >> 1 file changed, 7 insertions(+), 6 deletions(-) >> >> diff --git a/linux-user/syscall.c b/linux-user/syscall.c >> index 18ea79140f16..8b364551c311 100644 >> --- a/linux-user/syscall.c >> +++ b/linux-user/syscall.c >> @@ -12092,15 +12092,16 @@ abi_long do_syscall(void *cpu_env, int num, >> abi_long arg1, >> { >> struct mq_attr posix_mq_attr_in, posix_mq_attr_out; >> ret = 0; > > you can remove this line
in fact, you must keep this line because ret is not update if arg2 == NULL and arg3 == NULL. Thanks, Laurent