diff options
author | Alan Modra <amodra@bigpond.net.au> | 2005-06-08 03:51:32 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2005-06-08 03:51:32 +0000 |
commit | f51a051ca672de018a7dca127ea56c225a339097 (patch) | |
tree | db7f15753a6450187911a3c847f42bfc0f6bbbee /bfd/opncls.c | |
parent | 22e899a32602e789e1066fc677111d9a207cc0bb (diff) | |
download | gdb-f51a051ca672de018a7dca127ea56c225a339097.tar.gz |
* opncls.c (bfd_fdopenr): Don't set bfd_error unconditionally.
Diffstat (limited to 'bfd/opncls.c')
-rw-r--r-- | bfd/opncls.c | 6 |
1 files changed, 4 insertions, 2 deletions
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)) |