From 0e83ceb1b98bc601d6509f47417b37af63cd81d6 Mon Sep 17 00:00:00 2001 From: Douglas B Rupp Date: Tue, 15 Jan 2002 09:34:56 -0500 Subject: [PATCH] mkstemps.c (mkstemps): On VMS, open temp file with option that causes it to be deleted when closed. * libiberty/mkstemps.c (mkstemps): On VMS, open temp file with option that causes it to be deleted when closed. * gcc/gcc.c (delete_if_ordinary): Backout previous change. From-SVN: r48872 --- gcc/ChangeLog | 8 +++++--- gcc/gcc.c | 4 +--- libiberty/ChangeLog | 5 +++++ libiberty/mkstemps.c | 4 ++++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 70428b15078..41614613086 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,10 +1,12 @@ +2002-01-15 Douglas B Rupp + + * gcc.c (delete_if_ordinary): Backout previous change. + 2002-01-15 Kazu Hirata - * confiig/h8300/h8300.c (print_operand): Remove support for + * config/h8300/h8300.c (print_operand): Remove support for unused operand characters. -2002-01-15 Kazu Hirata - * read-rtl.c: Fix formatting. * real.c: Likewise. * recog.c: Likewise. diff --git a/gcc/gcc.c b/gcc/gcc.c index d5472d33ddf..65ee5fab0ee 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -2110,9 +2110,7 @@ delete_if_ordinary (name) if (i == 'y' || i == 'Y') #endif /* DEBUG */ - /* On VMS, more than one version of the temporary file may have been - created. This ensures we delete all of them. */ - while (stat (name, &st) >= 0 && S_ISREG (st.st_mode)) + if (stat (name, &st) >= 0 && S_ISREG (st.st_mode)) if (unlink (name) < 0) if (verbose_flag) perror_with_name (name); diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index fdccb59ab43..43a2951dae1 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2002-01-15 Douglas B Rupp + + * mkstemps.c (mkstemps): On VMS, open temp file with option + that causes it to be deleted when closed. + 2002-01-02 Kaveh R. Ghazi * cp-demangle.c (long_options): Const-ify. diff --git a/libiberty/mkstemps.c b/libiberty/mkstemps.c index 8fe5784f189..1f6600a15b9 100644 --- a/libiberty/mkstemps.c +++ b/libiberty/mkstemps.c @@ -121,7 +121,11 @@ mkstemps (template, suffix_len) v /= 62; XXXXXX[5] = letters[v % 62]; +#ifdef VMS + fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600, "fop=tmd"); +#else fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600); +#endif if (fd >= 0) /* The file does not exist. */ return fd;