* lib/spawni.c (do_dup2): Fix the flags of the new fd.
+2022-09-09 Bruno Haible <bruno@clisp.org>
+
+ posix_spawn-internal: Don't lose flags while duplicating an fd.
+ * lib/spawni.c (do_dup2): Fix the flags of the new fd.
+
2022-09-09 Bruno Haible <bruno@clisp.org>
spawn-pipe: Fix pipe-filter-* test hangs (regression 2020-12-24).
errno = EBADF; /* arbitrary */
return -1;
}
- inh_handles->flags[newfd] = KEEP_OPEN_IN_CHILD;
+ inh_handles->flags[newfd] =
+ (unsigned char) inh_handles->flags[oldfd] | KEEP_OPEN_IN_CHILD;
}
return 0;
}