diff options
author | rupp <rupp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-04-29 15:28:42 +0000 |
---|---|---|
committer | rupp <rupp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-04-29 15:28:42 +0000 |
commit | 767efd18dd81f73b1b69029182b1bc5b2b0b3c1d (patch) | |
tree | 7cc52a06db61f0e92a9c98a34aa14fcf0072b299 /gcc/gcc.c | |
parent | f07ea0913bf116812c3507bef1be222267467b11 (diff) | |
download | gcc-767efd18dd81f73b1b69029182b1bc5b2b0b3c1d.tar.gz |
* gcc.c (DELETE_IF_ORDINARY): New macro default definition.
(delete_if_ordinary): Use above macro.
* config/alpha/xm-vms.h (DELETE_IF_ORDINARY): New macro VMS definition.
Update copyright.
* doc/hostconfig.texi (DELETE_IF_ORDINARY): Document new macro.
* libiberty/mkstemps.c (mkstemps) [VMS]: Remove special open option.
Update copyright.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index 4e4f93b9ccd..4434e791aa0 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -2245,6 +2245,17 @@ record_temp_file (const char *filename, int always_delete, int fail_delete) /* Delete all the temporary files whose names we previously recorded. */ +#ifndef DELETE_IF_ORDINARY +#define DELETE_IF_ORDINARY(NAME,ST,VERBOSE_FLAG) \ +do \ + { \ + if (stat (NAME, &ST) >= 0 && S_ISREG (ST.st_mode)) \ + if (unlink (NAME) < 0) \ + if (VERBOSE_FLAG) \ + perror_with_name (NAME); \ + } while (0) +#endif + static void delete_if_ordinary (const char *name) { @@ -2261,10 +2272,7 @@ delete_if_ordinary (const char *name) if (i == 'y' || i == 'Y') #endif /* DEBUG */ - if (stat (name, &st) >= 0 && S_ISREG (st.st_mode)) - if (unlink (name) < 0) - if (verbose_flag) - perror_with_name (name); + DELETE_IF_ORDINARY (name, st, verbose_flag); } static void |