summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2013-12-12 16:22:06 +1100
committerTony Cook <tony@develop-help.com>2013-12-18 13:42:53 +1100
commitee71f1d151acd0a4c10ebcec28f0798178529847 (patch)
tree4be0e61b90cc8e3204ea1fc66083f25ec3fee819 /pp_sys.c
parent6b0ff4b4f2542a206738f2f065066e9bf895cbf4 (diff)
downloadperl-ee71f1d151acd0a4c10ebcec28f0798178529847.tar.gz
[perl #118651] don't overwrite $! in readdir()
POSIX expects readdir() to leave errno alone when it reaches end of directory without an error so that case can be detected. Do the same in perl.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 6f4c198d49..74b65f7b67 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3858,7 +3858,7 @@ PP(pp_readdir)
} while (gimme == G_ARRAY);
if (!dp && gimme != G_ARRAY)
- goto nope;
+ RETPUSHUNDEF;
RETURN;