From: Perl 5 Porters Date: Sat, 20 Jul 1996 06:56:18 +0000 (+0000) Subject: perl 5.003_01: doio.c X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=517844ec99ebe2d880df96289d21cffbf8a8b217;p=p5sagit%2Fp5-mst-13.2.git perl 5.003_01: doio.c Add curlies to nested expression for clarity Rename keyword 'explicit' to eliminate C++ collision Rename chsize() function to avoid collision with libc on some systems Use macro for shell name as part of OS/2 support Support 64-bit times --- diff --git a/doio.c b/doio.c index f28da95..575427a 100644 --- a/doio.c +++ b/doio.c @@ -192,9 +192,10 @@ FILE *supplied_fp; } if (dodup) fd = dup(fd); - if (!(fp = fdopen(fd,mode))) + if (!(fp = fdopen(fd,mode))) { if (dodup) close(fd); + } } } else { @@ -520,13 +521,14 @@ badexit: } #endif +/* explicit renamed to avoid C++ conflict -- kja */ bool #ifndef CAN_PROTOTYPE -do_close(gv,explicit) +do_close(gv,not_implicit) GV *gv; -bool explicit; +bool not_implicit; #else -do_close(GV *gv, bool explicit) +do_close(GV *gv, bool not_implicit) #endif /* CAN_PROTOTYPE */ { bool retval; @@ -540,12 +542,12 @@ do_close(GV *gv, bool explicit) } io = GvIO(gv); if (!io) { /* never opened */ - if (dowarn && explicit) + if (dowarn && not_implicit) warn("Close on unopened file <%s>",GvENAME(gv)); return FALSE; } retval = io_close(io); - if (explicit) { + if (not_implicit) { IoLINES(io) = 0; IoPAGE(io) = 0; IoLINES_LEFT(io) = IoPAGE_LEN(io); @@ -681,7 +683,7 @@ nuts: /* code courtesy of William Kucharski */ #define HAS_CHSIZE -I32 chsize(fd, length) +I32 my_chsize(fd, length) I32 fd; /* file descriptor */ Off_t length; /* length to set file to */ { @@ -1012,7 +1014,7 @@ char *cmd; break; } doshell: - execl("/bin/sh","sh","-c",cmd,(char*)0); + execl(SH_PATH, "sh", "-c", cmd, (char*)0); return FALSE; } } @@ -1188,8 +1190,13 @@ register SV **sp; #endif Zero(&utbuf, sizeof utbuf, char); +#ifdef BIG_TIME + utbuf.actime = (Time_t)SvNVx(*++mark); /* time accessed */ + utbuf.modtime = (Time_t)SvNVx(*++mark); /* time modified */ +#else utbuf.actime = SvIVx(*++mark); /* time accessed */ utbuf.modtime = SvIVx(*++mark); /* time modified */ +#endif tot = sp - mark; while (++mark <= sp) { if (utime(SvPVx(*mark, na),&utbuf))