Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.005_03 sets close-on-exec for pipe() (change from _02) #62

Closed
p5pRT opened this issue Jun 13, 1999 · 1 comment
Closed

5.005_03 sets close-on-exec for pipe() (change from _02) #62

p5pRT opened this issue Jun 13, 1999 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented Jun 13, 1999

Migrated from rt.perl.org#863 (status was 'resolved')

Searchable as RT863$

@p5pRT
Copy link
Author

p5pRT commented Jun 13, 1999

From rra@stanford.edu

____________________________________________________________________________
[ 2232] By​: gbarr on 1998/11/13 03​:12​:37
  Log​: integrate change#2215 from mainline
  set close-on-exec bit on pipe() FDs
  Branch​: maint-5.005/perl
  ! pod/perlfunc.pod pod/perlvar.pod pp_sys.c

is the change that adds​:

#if defined(HAS_FCNTL) && defined(F_SETFD)
  fcntl(fd[0],F_SETFD,fd[0] > PL_maxsysfd); /* ensure close-on-exec */
  fcntl(fd[1],F_SETFD,fd[1] > PL_maxsysfd); /* ensure close-on-exec */
#endif

to pp_pipe_op. I'm not sure what other people use pipe() for, but I was
using it to set up IPC with a child process. I'm guessing this mostly
went unnoticed because most people probably do this with stdin/stdout,
which are exempted from this. Anyway, this change broke PGP​::Sign on _03.

I can go add a call to fcntl() to unset close-on-exec, wrapped in eval in
case the platform doesn't have that stuff (does the import of F_SETFD from
Fcntl via use Fcntl qw(F_SETFD); fail on platforms that don't have it?),
but this would seem to me to be a bit of a big change for the maintenance
release.

--
Russ Allbery (rra@​stanford.edu) <URL​:http​://www.eyrie.org/~eagle/>

@p5pRT p5pRT closed this as completed Nov 28, 2003
khwilliamson pushed a commit to khwilliamson/perl5 that referenced this issue Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant