aboutsummaryrefslogtreecommitdiff
path: root/bfd/opncls.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-06-08 03:51:32 +0000
committerAlan Modra <amodra@gmail.com>2005-06-08 03:51:32 +0000
commitd83747fa84e7bea0475a0c7fcf000c3f91f83b61 (patch)
tree5435ec3b52844e5caa03aced10dc7b74fba5cc67 /bfd/opncls.c
parent92a7c1b8ba9db048564ed12b55d2e9ef78e7e53b (diff)
downloadgdb-d83747fa84e7bea0475a0c7fcf000c3f91f83b61.zip
gdb-d83747fa84e7bea0475a0c7fcf000c3f91f83b61.tar.gz
gdb-d83747fa84e7bea0475a0c7fcf000c3f91f83b61.tar.bz2
* opncls.c (bfd_fdopenr): Don't set bfd_error unconditionally.
Diffstat (limited to 'bfd/opncls.c')
-rw-r--r--bfd/opncls.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bfd/opncls.c b/bfd/opncls.c
index 112401a..df2cf6d 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))