29 Apr
2015
29 Apr
'15
10:22 a.m.
On Wed, 29 Apr 2015, Henri Verbeet wrote: [...]
Arguably it shouldn't be using UINT32_MAX at all, since it isn't actually used with uint32_t. I guess it should be using e.g. unsigned int with UINT_MAX instead.
The timeout receives a 64 bit value so using an unsigned int would not work. But using UINT_MAX plus the native limits.h can work. static inline INT64 get_rcvsnd_timeo( int fd, BOOL is_recv) ... timeout = get_rcvsnd_timeo(fd, optname == WS_SO_RCVTIMEO); *(int *)optval = timeout <= UINT32_MAX ? timeout : UINT32_MAX; -- Francois Gouget <fgouget(a)free.fr> http://fgouget.free.fr/ You can have my guns when you pry them from my kids cold, dead hands.