Re: [Qemu-devel] [PATCH 2/3] linux-user: add SO_LINGER to setsockopt

2017-09-20 Thread Carlo Arenas
On Wed, Sep 20, 2017 at 11:53 AM, Laurent Vivier wrote: > > the test for optlen is replaced by passing optlen to the underlying > > setsockopt call directly, who would do the test and return the right > error. > > You can't do that, because sizeof(struct linger) may be different from > sizeof(str

Re: [Qemu-devel] [PATCH 2/3] linux-user: add SO_LINGER to setsockopt

2017-09-20 Thread Laurent Vivier
Le 20/09/2017 à 19:29, Carlo Arenas a écrit : > On Wed, Sep 20, 2017 at 1:39 AM, Laurent Vivier > wrote: > > Why did you remove "optname = SO_LINGER" and "if (optlen != > sizeof(struct target_linger))"? > > > the optname assignment is not really needed, since i

Re: [Qemu-devel] [PATCH 2/3] linux-user: add SO_LINGER to setsockopt

2017-09-20 Thread Carlo Arenas
On Wed, Sep 20, 2017 at 1:39 AM, Laurent Vivier wrote: > > Why did you remove "optname = SO_LINGER" and "if (optlen != > sizeof(struct target_linger))"? > the optname assignment is not really needed, since it is only used for the setsockopt call and that call is clearer using SO_LINGER directly,

Re: [Qemu-devel] [PATCH 2/3] linux-user: add SO_LINGER to setsockopt

2017-09-20 Thread Laurent Vivier
Le 20/09/2017 à 01:06, Carlo Marcelo Arenas Belón a écrit : > Original implementation by Chen Gang; all bugs mine > > Signed-off-by: Chen Gang > Signed-off-by: Carlo Marcelo Arenas Belón > --- > linux-user/syscall.c | 15 +++ > linux-user/syscall_defs.h | 5 + > 2 files ch

[Qemu-devel] [PATCH 2/3] linux-user: add SO_LINGER to setsockopt

2017-09-19 Thread Carlo Marcelo Arenas Belón
Original implementation by Chen Gang; all bugs mine Signed-off-by: Chen Gang Signed-off-by: Carlo Marcelo Arenas Belón --- linux-user/syscall.c | 15 +++ linux-user/syscall_defs.h | 5 + 2 files changed, 20 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/sysc