linux-user: do_setsockopt: make ip_mreq local to the place it is used and inline...
commit124a1341a66287ab8f4ce3de3c98eed6747a639f
authorMichael Tokarev <mjt@tls.msk.ru>
Sun, 31 Mar 2024 10:07:35 +0000 (31 13:07 +0300)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 24 Apr 2024 22:46:00 +0000 (24 15:46 -0700)
tree52d32cf10f66d2c57a438d73a8a8c0a139bc3ea2
parent04f6fb897a5aeb3e356a7b889869c9962f9c16c7
linux-user: do_setsockopt: make ip_mreq local to the place it is used and inline target_to_host_ip_mreq()

ip_mreq is declared at the beginning of do_setsockopt(), while
it is used in only one place.  Move its declaration to that very
place and replace pointer to alloca()-allocated memory with the
structure itself.

target_to_host_ip_mreq() is used only once, inline it.

This change also properly handles TARGET_EFAULT when the address
is wrong.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Message-Id: <20240331100737.2724186-3-mjt@tls.msk.ru>
[rth: Fix braces, adjust optlen to match host structure size]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/syscall.c