From: Alan Modra Date: Wed, 8 Jun 2005 03:51:32 +0000 (+0000) Subject: * opncls.c (bfd_fdopenr): Don't set bfd_error unconditionally. X-Git-Tag: gdb_6_4-branchpoint~1071 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d83747fa84e7bea0475a0c7fcf000c3f91f83b61;p=thirdparty%2Fbinutils-gdb.git * opncls.c (bfd_fdopenr): Don't set bfd_error unconditionally. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6b8388f6c74..58f3b9129b8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,6 +1,7 @@ 2005-06-08 Alan Modra * opncls.c (bfd_fopen): Don't set bfd_error unconditionally. + (bfd_fdopenr): Same. 2005-06-07 Mark Mitchell diff --git a/bfd/opncls.c b/bfd/opncls.c index 112401aee54..df2cf6d3ea4 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -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))