Nicolas Boulenguez wrote:
> If I understand well fcntl(2), the following patch may solve this bug.
> Stefan, would you please try to rebuild and test?
>
> --- bash.preinst-lib.c 2012-11-28 15:56:04.000000000 +0100
> +++ bash.preinst-lib.c.new 2012-11-28 17:07:09.000000000 +0100
> @@ -60,8 +60,8 @@
>
> void set_cloexec(int fd)
> {
> - int flags = fcntl(fd, F_GETFL);
> - if (flags < 0 || fcntl(fd, F_SETFL, flags | FD_CLOEXEC))
> + int flags = fcntl(fd, F_GETFD);
> + if (flags < 0 || fcntl(fd, F_SETFD, flags | FD_CLOEXEC))
> die_errno("cannot set close-on-exec flag");
Good eyes. Thanks for figuring it out.
For what it's worth,
Reviewed-by: Jonathan Nieder <[email protected]>
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]