X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perlio.c;h=7c16e435b0cfd1cc317e93a144f4951c34a8620d;hb=10cb7778b2425656148151f1517d115436333ccf;hp=5584d64abe96d2a15f3e3b568c998a2764233fc8;hpb=ecdeb87c58ecf41e283516bbe30cb8616ec66e13;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perlio.c b/perlio.c index 5584d64..7c16e43 100644 --- a/perlio.c +++ b/perlio.c @@ -2496,9 +2496,7 @@ PerlIOStdio_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags) int fd = PerlLIO_dup(fileno(stdio)); if (fd >= 0) { char mode[8]; - int omode = fcntl(fd, F_GETFL); - PerlIO_intmode2str(omode,mode,NULL); - stdio = fdopen(fd, mode); + stdio = fdopen(fd, PerlIO_modestr(o,mode)); } else { /* FIXME: To avoid messy error recovery if dup fails