p4raw-id: //depot/perlio@13080
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