* gcc.c (delete_if_ordinary): Delete all versions.
authorDouglas B Rupp <rupp@gnat.com>
Tue, 1 Jan 2002 21:48:58 +0000 (16:48 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 1 Jan 2002 21:48:58 +0000 (16:48 -0500)
From-SVN: r48450

gcc/ChangeLog
gcc/gcc.c

index 2f80992680143e3b1211b510cfb9eb5e181d4326..f7bb480a769933b0bd8857d0254405fe95d28d5b 100644 (file)
@@ -1,3 +1,7 @@
+2002-01-01  Douglas B Rupp  <rupp@gnat.com>
+
+       * gcc.c (delete_if_ordinary): Delete all versions.
+
 2002-01-01  Hans-Peter Nilsson  <hp@bitrange.com>
 
        * config/mmix/mmix.md: Update FIXME to not mention
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);