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]

Patch: Tweak collect2 for mingw32


Hello

The following tweak, already on csl-arm branch, is needed for collect2 on
windows host.

	Apply from csl-arm-branch.
	2004-02-12  Mark Mithchell  <mmitchel@gcc.gnu.org>

	* tlink.c (recompile_files): Do not assume that "rename" can
	overwrite an existing file.

Index: gcc/gcc/tlink.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tlink.c,v
retrieving revision 1.59
diff -c -3 -p -r1.59 tlink.c
*** gcc/gcc/tlink.c	9 Nov 2004 10:12:19 -0000	1.59
--- gcc/gcc/tlink.c	29 Mar 2005 05:50:44 -0000
*************** recompile_files (void)
*** 468,474 ****
  	}
        fclose (stream);
        fclose (output);
!       rename (outname, f->key);
  
        if (!f->args)
  	{
--- 468,480 ----
  	}
        fclose (stream);
        fclose (output);
!       /* On Windows "rename" returns -1 and sets ERRNO to EACCESS if
! 	 the new file name already exists.  Therefore, we explicitly
! 	 remove the old file first.  */
!       if (remove (f->key) == -1)
! 	fatal_perror ("removing .rpo file");
!       if (rename (outname, f->key) == -1)
! 	fatal_perror ("renaming .rpo file");
  
        if (!f->args)
  	{

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com


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