This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Mainline patch to stop collect2 unlinking directories


This patch, the mainline version of
<http://gcc.gnu.org/ml/gcc-patches/2005-06/msg00092.html>, stops
collect2 from unlinking non-regular files when there is a linker error
(in particular stopping it from unlinking a directory named as linker
output on systems allowing directories to be unlinked).

Bootstrapped with no regressions on i386-pc-solaris2.10.1.  OK to
commit?

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

2005-06-03  Joseph S. Myers  <joseph@codesourcery.com>

	* collect2.c (maybe_unlink): Use unlink_if_ordinary.

--- collect2.c.orig	2005-04-26 19:58:33.000000000 +0000
+++ collect2.c	2005-06-02 23:02:39.000000000 +0000
@@ -1606,7 +1606,7 @@ static void
 maybe_unlink (const char *file)
 {
   if (!debug)
-    unlink (file);
+    unlink_if_ordinary (file);
   else
     notice ("[Leaving %s]\n", file);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]