diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-09-11 09:37:23 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-09-11 09:37:23 -0700 |
commit | c9006f7963382ba4ff4a0b37271f1cfbaae583d7 (patch) | |
tree | c20968c854ab92cd975197d40c572f421fb96dbc /ftw.c | |
parent | 8335ac0f99cfe816afd5be341aae9a1c968deb2c (diff) | |
download | txr-c9006f7963382ba4ff4a0b37271f1cfbaae583d7.tar.gz txr-c9006f7963382ba4ff4a0b37271f1cfbaae583d7.tar.bz2 txr-c9006f7963382ba4ff4a0b37271f1cfbaae583d7.zip |
sockets: bug in clearing SOCK_* type flags.
Paul A. Patience reports a regression in
3d5d525eb525cfad8f643917c31e3d9fedce2874, whereby the code
marked with #if SOCK_NONBLOCK || SOCK_CLOEXEC is being
excluded by the preprocoessor, and so those flags are not
being cleared from the socket type that we retain.
This is because these preprocessor symbols are not necessarily
integer constants. They may expand to C enum identifiers,
in which case, in preprocessor expressions they appear to take
on the value zero.
* socket.c (open_socket, socketpair_wrap): Use the if
statement to test for SOCK_NONBLOCK or SOCK_CLOEXEC being
nonzero, rather than a preprocessor #if. This should still be
optimized away as unreachable code if they are zero.
* tests/014/socket-misc.tl: New file.
Diffstat (limited to 'ftw.c')
0 files changed, 0 insertions, 0 deletions