|
From: Aaron S. <and...@ra...> - 2003-02-11 17:18:48
|
On Tue, 11 Feb 2003, James Yonan wrote:
> /* Set a file descriptor to not be passed across execs */
> void
> set_cloexec (int fd)
> {
> if (fcntl (fd, F_SETFD, FD_CLOEXEC) < 0)
> msg (M_ERR, "Set file descriptor to FD_CLOEXEC failed");
> }
>
> Just set the FD_CLOEXEC flag on the fd and it won't be passed across the exec
> that runs the shell.
That works even better then :)
Regards,
Aaron
|