]> git.proxmox.com Git - mirror_qemu.git/commit
linux-user: improve target_to_host_sock_type conversion
authorPetar Jovanovic <petar.jovanovic@imgtec.com>
Mon, 1 Jul 2013 00:44:14 +0000 (02:44 +0200)
committerRiku Voipio <riku.voipio@linaro.org>
Fri, 5 Jul 2013 12:45:40 +0000 (15:45 +0300)
commitf651e6ae55b047a8ac4b6b5891fe69ba4c66c57c
tree6a5d726a907176a6fcf7725becbe72ea6f1d4336
parent023b0ae33be6ce2e60d75d2b54a3d2cea6b6020e
linux-user: improve target_to_host_sock_type conversion

Previous implementation has failed to take into account different value of
SOCK_NONBLOCK on target and host, and existence of SOCK_CLOEXEC.
The same conversion has to be applied both for do_socket and do_socketpair,
so the code has been isolated in a static inline function.

enum sock_type in linux-user/socket.h has been extended to include
TARGET_SOCK_CLOEXEC and TARGET_SOCK_NONBLOCK, similar to definition in libc.
The patch also includes necessary code style changes (tab to spaces) in the
header file since most of the file has been touched by this change.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Message-id: 1372639454-7560-1-git-send-email-petar.jovanovic@rt-rk.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
linux-user/socket.h
linux-user/syscall.c