#if defined(__GO32__) || defined(_WIN32) || defined(__CYGWIN__)
if (scratch_chan < 0)
{
+ int first_errno = errno;
char *exename = (char *) alloca (strlen (filename) + 5);
strcat (strcpy (exename, filename), ".exe");
O_RDWR | O_BINARY
: O_RDONLY | O_BINARY,
&scratch_storage);
+ if (scratch_chan < 0)
+ errno = first_errno;
}
#endif
if (scratch_chan < 0)
unsigned count;
count = bfd_count_sections (some_bfd);
- if (*start)
- xfree (* start);
+ xfree (*start);
*start = XNEWVEC (struct target_section, count);
*end = *start;
bfd_map_over_sections (some_bfd, add_to_section_table, (char *) end);