* opncls.c (bfd_fdopenr): Don't set bfd_error unconditionally.

This commit is contained in:
Alan Modra 2005-06-08 03:51:32 +00:00
parent 92a7c1b8ba
commit d83747fa84
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
2005-06-08 Alan Modra <amodra@bigpond.net.au>
* opncls.c (bfd_fopen): Don't set bfd_error unconditionally.
(bfd_fdopenr): Same.
2005-06-07 Mark Mitchell <mark@codesourcery.com>

View File

@ -268,13 +268,15 @@ bfd_fdopenr (const char *filename, const char *target, int fd)
int fdflags;
#endif
bfd_set_error (bfd_error_system_call);
#if ! defined(HAVE_FCNTL) || ! defined(F_GETFL)
mode = FOPEN_RUB; /* Assume full access. */
#else
fdflags = fcntl (fd, F_GETFL, NULL);
if (fdflags == -1)
return NULL;
{
bfd_set_error (bfd_error_system_call);
return NULL;
}
/* (O_ACCMODE) parens are to avoid Ultrix header file bug. */
switch (fdflags & (O_ACCMODE))