This is the mail archive of the
mailing list for the GCC project.
Patch: fix PR java/14315
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: 23 Mar 2004 10:29:44 -0700
- Subject: Patch: fix PR java/14315
- Reply-to: tromey at redhat dot com
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?
from Tom Tromey <email@example.com>
* jcf-write.c (make_class_file_name): Don't report if mkdir
failed with EEXIST.
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)
*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;