+2001-01-30 Bruce Korb <bkorb@gnu.org>
+
+ fixinc/fixincl.c(process): Emit error message only if appropriate :)
+ (load_file): do not rely on load_file_data() to close file pointer
+ fixinc/fixlib.c(load_file_data): do not close passed in file pointer
+ fixinc/inclhack.def(irix_limits_const): add test_text
+
2001-02-06 Neil Booth <neil@daikokuya.demon.co.uk>
* cppexp.c (parse_defined): Improve diagnostics for invalid
res = (char*)mmap ((void*)NULL, data_map_size, PROT_READ,
MAP_PRIVATE, data_map_fd, 0);
if (res == (char*)BAD_ADDR)
+#endif
{
+ FILE* fp = fdopen (data_map_fd, "r");
curr_data_mapped = BOOL_FALSE;
- res = load_file_data ( fdopen (data_map_fd, "r"));
+ res = load_file_data (fp);
+ fclose (fp);
}
-#else
- curr_data_mapped = BOOL_FALSE;
- res = load_file_data ( fdopen (data_map_fd, "r"));
-#endif
return res;
}
read_fd = open (pz_temp_file, O_RDONLY);
if (read_fd < 0)
{
- fprintf (stderr, "error %d (%s) opening output (%s) for read\n",
- errno, xstrerror (errno), pz_temp_file);
+ if (errno != ENOENT)
+ fprintf (stderr, "error %d (%s) opening output (%s) for read\n",
+ errno, xstrerror (errno), pz_temp_file);
}
else
{
int space_left = -1; /* allow for terminating NUL */
size_t space_used = 0;
+ if (fp == (FILE*)NULL)
+ return pz_data;
+
do
{
size_t size_read;
fprintf (stderr, "error %d (%s) reading input\n", err,
xstrerror (err));
free ((void *) pz_data);
- fclose (fp);
return (char *) NULL;
}
}
pz_data = xrealloc ((void*)pz_data, space_used+1 );
pz_data[ space_used ] = NUL;
- fclose (fp);
return pz_data;
}