aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 4e4f93b..4434e79 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