summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-07-20 06:56:18 +0000
committerCharles Bailey <bailey@genetics.upenn.edu>1996-07-20 06:56:18 +0000
commit517844ec99ebe2d880df96289d21cffbf8a8b217 (patch)
treebf77ae7402513b3554d6dbadcecb218c29c43c63 /doio.c
parent0c2634fcd1d84b99d20ef77de231400d450a99dd (diff)
downloadperl-517844ec99ebe2d880df96289d21cffbf8a8b217.tar.gz
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
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/doio.c b/doio.c
index f28da95521..575427a7ad 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))