diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-16 19:20:37 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-16 19:20:37 +0000 |
commit | 22bc48d7a02ad074284858db5700b128d4254625 (patch) | |
tree | bfe8080c60441f4d4c27eff7d0b1a97b2b6cfc2d /doio.c | |
parent | 089c015b3a0d1c9d3f152ace22b1d60ce258b208 (diff) | |
download | perl-22bc48d7a02ad074284858db5700b128d4254625.tar.gz |
A fix of sorts for the flush-before-dup scenario.
p4raw-id: //depot/cfgperl@3997
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -283,8 +283,17 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw, } if (IoIFP(thatio)) { PerlIO *fp = IoIFP(thatio); - /* Flush stdio buffer before dup */ + /* Flush stdio buffer before dup. --mjd + * Unfortunately SEEK_CURing 0 seems to + * be optimized away on most platforms; + * only Solaris and Linux seem to flush + * on that. --jhi */ PerlIO_seek(fp, 0, SEEK_CUR); + /* On the other hand, do all platforms + * take gracefully to flushing a read-only + * filehandle? Perhaps we should do + * fsetpos(src)+fgetpos(dst)? --nik */ + PerlIO_flush(fp); fd = PerlIO_fileno(fp); if (IoTYPE(thatio) == 's') IoTYPE(io) = 's'; |