summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-14 00:07:46 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-14 00:07:46 -0800
commit2ad48547234bdf521daff432b65a0b173efd2a19 (patch)
tree9b32f61c1f8db0b7df9a8a4e88c1054e8f230a74 /pp_sys.c
parent31b139ba853d7a7a7b30c4c0e7a90020a641854d (diff)
downloadperl-2ad48547234bdf521daff432b65a0b173efd2a19.tar.gz
Make -T BADHANDLE set errno with fatal warnings
Due to the order of the statements, SETERRNO would never be reached with fatal warnings. I’ve added another SETERRNO out of paranoia. If there is a nicely- behaved __WARN__ handler, we should still be setting errno just before -T returns, in case the handler changed it. We can’t do much in the case of fatal handlers that do system calls. (Is $! localised for those?)
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 3757401019..77677647c1 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3359,6 +3359,7 @@ PP(pp_fttext)
len = 512;
}
else {
+ SETERRNO(EBADF,RMS_IFI);
report_evil_fh(gv);
SETERRNO(EBADF,RMS_IFI);
RETPUSHUNDEF;