summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-04-15 17:00:54 +0000
committerNicholas Clark <nick@ccl4.org>2006-04-15 17:00:54 +0000
commit0f7de14d8669cd6dcee1170d6d9b7b40f82657fa (patch)
tree9159370664455fe95ba9a3a41ea70cd46c0f6502 /pp_ctl.c
parentbccf3f3d1e8232741671a14320e468bb69bd7bed (diff)
downloadperl-0f7de14d8669cd6dcee1170d6d9b7b40f82657fa.tar.gz
Eliminate the filter_child_proc hack from pp_require.
p4raw-id: //depot/perl@27815
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 364a1d5052..2c36b59a09 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3067,7 +3067,6 @@ PP(pp_require)
const I32 gimme = GIMME_V;
int filter_has_file = 0;
PerlIO *tryrsfp = NULL;
- GV *filter_child_proc = NULL;
SV *filter_state = NULL;
SV *filter_sub = NULL;
SV *hook_sv = NULL;
@@ -3186,23 +3185,11 @@ PP(pp_require)
if (io) {
tryrsfp = IoIFP(io);
- if (IoTYPE(io) == IoTYPE_PIPE) {
- /* reading from a child process doesn't
- nest -- when returning from reading
- the inner module, the outer one is
- unreadable (closed?) I've tried to
- save the gv to manage the lifespan of
- the pipe, but this didn't help. XXX */
- filter_child_proc = (GV *)arg;
- SvREFCNT_inc_simple_void(filter_child_proc);
- }
- else {
- if (IoOFP(io) && IoOFP(io) != IoIFP(io)) {
- PerlIO_close(IoOFP(io));
- }
- IoIFP(io) = NULL;
- IoOFP(io) = NULL;
+ if (IoOFP(io) && IoOFP(io) != IoIFP(io)) {
+ PerlIO_close(IoOFP(io));
}
+ IoIFP(io) = NULL;
+ IoOFP(io) = NULL;
}
if (i < count) {
@@ -3237,10 +3224,6 @@ PP(pp_require)
}
filter_has_file = 0;
- if (filter_child_proc) {
- SvREFCNT_dec(filter_child_proc);
- filter_child_proc = NULL;
- }
if (filter_state) {
SvREFCNT_dec(filter_state);
filter_state = NULL;
@@ -3378,10 +3361,9 @@ PP(pp_require)
SAVESPTR(PL_compiling.cop_io);
PL_compiling.cop_io = NULL;
- if (filter_sub || filter_child_proc) {
+ if (filter_sub) {
SV * const datasv = filter_add(S_run_user_filter, NULL);
IoLINES(datasv) = filter_has_file;
- IoFMT_GV(datasv) = (GV *)filter_child_proc;
IoTOP_GV(datasv) = (GV *)filter_state;
IoBOTTOM_GV(datasv) = (GV *)filter_sub;
}