]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/gcc.c
* gcc.c (delete_if_ordinary): Delete all versions.
[thirdparty/gcc.git] / gcc / gcc.c
index 5094c3bfe0c99974d00d6ae626967565d2335a0b..25cbeb548210860ac23f3c897d66befc775f9225 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1,6 +1,6 @@
 /* Compiler driver program that can handle many languages.
    Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -2111,7 +2111,9 @@ delete_if_ordinary (name)
 
   if (i == 'y' || i == 'Y')
 #endif /* DEBUG */
-    if (stat (name, &st) >= 0 && S_ISREG (st.st_mode))
+    /* 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 (unlink (name) < 0)
        if (verbose_flag)
          perror_with_name (name);