}
/* Set the file descriptor flags for FD that correspond to the nonzero bits
- in FLAGS. The file's name is NAME. */
+ in ADD_FLAGS. The file's name is NAME. */
static void
set_fd_flags (int fd, int add_flags, char const *name)
if (add_flags)
{
int old_flags = fcntl (fd, F_GETFL);
- int new_flags = old_flags < 0 ? add_flags : (old_flags | add_flags);
+ int new_flags = old_flags | add_flags;
if (old_flags < 0
|| (new_flags != old_flags && fcntl (fd, F_SETFL, new_flags) == -1))
error (EXIT_FAILURE, errno, _("setting flags for %s"), quote (name));