projects
/
binutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
65505a3
)
Specify which filename is causing an error if the filename is a
author
David Kimdon
<dwhedon@gordian.com>
Fri, 15 May 2020 09:49:49 +0000
(10:49 +0100)
committer
Matthias Klose
<doko@debian.org>
Fri, 15 May 2020 09:49:49 +0000
(10:49 +0100)
directory. (#45832)
Gbp-Pq: Name 006_better_file_error.patch
bfd/opncls.c
patch
|
blob
|
history
diff --git
a/bfd/opncls.c
b/bfd/opncls.c
index a03ad51c8fae9a3a19ec610234f969621877b885..c89226c70ca579643ea7dd06c7ce89893a72cbdc 100644
(file)
--- a/
bfd/opncls.c
+++ b/
bfd/opncls.c
@@
-196,6
+196,13
@@
bfd_fopen (const char *filename, const char *target, const char *mode, int fd)
{
bfd *nbfd;
const bfd_target *target_vec;
+ struct stat s;
+
+ if (stat (filename, &s) == 0)
+ if (S_ISDIR(s.st_mode)) {
+ bfd_set_error (bfd_error_file_not_recognized);
+ return NULL;
+ }
nbfd = _bfd_new_bfd ();
if (nbfd == NULL)