This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: fix PR java/14315


This patch fixes PR java/14315.  The fix was tested by the reporter.
The basic idea is, don't give an error if the directory has already
been made by someone else.

Ok for trunk?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	PR java/14315:
	* jcf-write.c (make_class_file_name): Don't report if mkdir
	failed with EEXIST.

Index: jcf-write.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-write.c,v
retrieving revision 1.141
diff -u -r1.141 jcf-write.c
--- jcf-write.c 18 Mar 2004 20:58:49 -0000 1.141
+++ jcf-write.c 23 Mar 2004 17:40:42 -0000
@@ -1,5 +1,5 @@
 /* Write out a Java(TM) class file.
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -3392,9 +3392,11 @@
       if (s == NULL)
 	break;
       *s = '\0';
+      /* Try to make directory if it doesn't already exist.  */
       if (stat (r, &sb) == -1
-	  /* Try to make it.  */
-	  && mkdir (r, 0755) == -1)
+	  && mkdir (r, 0755) == -1
+	  /* The directory might have been made by another process.  */
+	  && errno != EEXIST)
 	fatal_error ("can't create directory %s: %m", r);
 
       *s = sep;


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