This is the mail archive of the 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]

Fix PR preprocessor/7312

Went un-noticed for months because of miscategorization under "other".
This patch will be credited to Bruno; it's his.


	* cppfiles.c (find_or_create_entry): Preserve errno.

Index: cppfiles.c
RCS file: /cvs/gcc/gcc/gcc/cppfiles.c,v
retrieving revision 1.168
diff -u -p -r1.168 cppfiles.c
--- cppfiles.c	21 Apr 2003 19:21:53 -0000	1.168
+++ cppfiles.c	10 May 2003 15:00:23 -0000
@@ -174,8 +174,10 @@ find_or_create_entry (pfile, fname)
   splay_tree_node node;
   struct include_file *file;
   char *name = xstrdup (fname);
+  int saved_errno;
   cpp_simplify_path (name);
+  saved_errno = errno;
   node = splay_tree_lookup (pfile->all_include_files, (splay_tree_key) name);
   if (node)
     free (name);
@@ -184,7 +186,7 @@ find_or_create_entry (pfile, fname)
       file = xcnew (struct include_file);
       file->name = name;
       file->header_name = name;
-      file->err_no = errno;
+      file->err_no = saved_errno;
       node = splay_tree_insert (pfile->all_include_files,
 				(splay_tree_key) file->name,
 				(splay_tree_value) file);

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