summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2014-03-01 17:58:05 +0100
committerNicholas Clark <nick@ccl4.org>2014-03-01 17:58:05 +0100
commit147f7004ad992729d7466a9b2229332c1b97ca3a (patch)
tree8f4f968c60f1e3a6ea04b1fbe1bf01f9dbc6bba8 /doio.c
parent25983af42cdcf2dc1fea6717dac7aac441b6301d (diff)
downloadperl-147f7004ad992729d7466a9b2229332c1b97ca3a.tar.gz
No need for code conditional on S_IFMT being defined, as perl.h has a fallback.
Commit c623bd54707a8bf9 (Jan 1991) added code conditionally compiled if S_IFMT was defined. However, the checks were immediately redundant, because the same commit also added code to perl.h to define a fallback value for S_IFMT if the OS headers did not define it, which is unchanged to this day. Hence the code added in an #else as part of commit 99b89507a1fb507c (Nov 1991) has never ever been needed.
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/doio.c b/doio.c
index 205365ae74..bdff84ca1e 100644
--- a/doio.c
+++ b/doio.c
@@ -579,11 +579,7 @@ Perl_do_openn(pTHX_ GV *gv, const char *oname, I32 len, int as_raw,
IoTYPE(io) = IoTYPE_SOCKET; /* in case a socket was passed in to us */
#ifdef HAS_SOCKET
else if (
-#ifdef S_IFMT
!(PL_statbuf.st_mode & S_IFMT)
-#else
- !PL_statbuf.st_mode
-#endif
&& IoTYPE(io) != IoTYPE_WRONLY /* Dups of STD* filehandles already have */
&& IoTYPE(io) != IoTYPE_RDONLY /* type so they aren't marked as sockets */
) { /* on OS's that return 0 on fstat()ed pipe */