From: Chip Salzenberg Date: Sun, 9 Feb 1997 23:36:54 +0000 (+1200) Subject: On C, call C X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=360e57411903f2d16ad89bcdf4a462fc97239653;p=p5sagit%2Fp5-mst-13.2.git On C, call C --- diff --git a/doio.c b/doio.c index 31c9a35..ec3181e 100644 --- a/doio.c +++ b/doio.c @@ -118,9 +118,16 @@ PerlIO *supplied_fp; if (fd == -1) fp = NULL; else { - fp = PerlIO_fdopen(fd, ((result == 0) ? "r" - : (result == 1) ? "w" - : "r+")); + char *fpmode; + if (result == 0) + fpmode = "r"; +#ifdef O_APPEND + else if (rawmode & O_APPEND) + fpmode = (result == 1) ? "a" : "a+"; +#endif + else + fpmode = (result == 1) ? "w" : "r+"; + fp = PerlIO_fdopen(fd, fpmode); if (!fp) close(fd); }