summaryrefslogtreecommitdiffstats
path: root/contrib/tcsh/sh.dol.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2000-11-30 21:05:33 +0000
committerache <ache@FreeBSD.org>2000-11-30 21:05:33 +0000
commit5e7fc01bd9bf3444f2d8b21ab1c56c1f2d599068 (patch)
treea212ee10b5214f5c4302ff44d44c2542d83cf7b6 /contrib/tcsh/sh.dol.c
parentd7d472004aa5fe13bc67f9aa639952d978d342e9 (diff)
downloadFreeBSD-src-5e7fc01bd9bf3444f2d8b21ab1c56c1f2d599068.zip
FreeBSD-src-5e7fc01bd9bf3444f2d8b21ab1c56c1f2d599068.tar.gz
Initial import of slightly trimmed tcsh 6.10
Diffstat (limited to 'contrib/tcsh/sh.dol.c')
-rw-r--r--contrib/tcsh/sh.dol.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/contrib/tcsh/sh.dol.c b/contrib/tcsh/sh.dol.c
index 4f1e9bd..5d13270 100644
--- a/contrib/tcsh/sh.dol.c
+++ b/contrib/tcsh/sh.dol.c
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/sh.dol.c,v 3.42 2000/10/31 16:55:52 christos Exp $ */
+/* $Header: /src/pub/tcsh/sh.dol.c,v 3.45 2000/11/19 20:50:43 christos Exp $ */
/*
* sh.dol.c: Variable substitutions
*/
@@ -36,7 +36,7 @@
*/
#include "sh.h"
-RCSID("$Id: sh.dol.c,v 3.42 2000/10/31 16:55:52 christos Exp $")
+RCSID("$Id: sh.dol.c,v 3.45 2000/11/19 20:50:43 christos Exp $")
/*
* C shell
@@ -1025,9 +1025,11 @@ heredoc(term)
Char **vp;
bool quoted;
char *tmp;
+#ifndef WINNT_NATIVE
struct timeval tv;
again:
+#endif /* WINNT_NATIVE */
tmp = short2str(shtemp);
#ifndef O_CREAT
# define O_CREAT 0
@@ -1043,14 +1045,16 @@ again:
#endif
if (open(tmp, O_RDWR|O_CREAT|O_EXCL|O_TEMPORARY) == -1) {
int oerrno = errno;
+#ifndef WINNT_NATIVE
if (errno == EEXIST) {
if (unlink(tmp) == -1) {
(void) gettimeofday(&tv, NULL);
shtemp = Strspl(STRtmpsh, putn((((int)tv.tv_sec) ^
- ((int)tv.tv_usec) ^ ((int)doldol)) & 0x00ffffff));
+ ((int)tv.tv_usec) ^ ((int)getpid())) & 0x00ffffff));
}
goto again;
}
+#endif /* WINNT_NATIVE */
(void) unlink(tmp);
errno = oerrno;
stderror(ERR_SYSTEM, tmp, strerror(errno));
@@ -1065,9 +1069,9 @@ again:
ocnt = BUFSIZE;
obp = obuf;
inheredoc = 1;
-#ifdef WINNT
+#ifdef WINNT_NATIVE
__dup_stdin = 1;
-#endif /* WINNT */
+#endif /* WINNT_NATIVE */
for (;;) {
/*
* Read up a line
OpenPOWER on IntegriCloud