Re: [Libguestfs] [libnbd PATCH v3 13/29] socket activation: avoid manipulating the sign bit

2023-02-15 Thread Richard W.M. Jones
[I've no idea about this, adding Eric to CC for attention] On Wed, Feb 15, 2023 at 03:11:42PM +0100, Laszlo Ersek wrote: > F_SETFD takes an "int", so it stands to reason that FD_CLOEXEC expands to > an "int". In turn, it's bad hygiene to manipulate the sign bit of (signed) > integers with bit

[Libguestfs] [libnbd PATCH v3 13/29] socket activation: avoid manipulating the sign bit

2023-02-15 Thread Laszlo Ersek
F_SETFD takes an "int", so it stands to reason that FD_CLOEXEC expands to an "int". In turn, it's bad hygiene to manipulate the sign bit of (signed) integers with bit operations: ~FD_CLOEXEC Convert FD_CLOEXEC to "unsigned int" for the bitwise complement operator: ~(unsigned)FD_CLOEXEC The