projects
/
binutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
63e9a81
)
Specify which filename is causing an error if the filename is a
author
David Kimdon
<dwhedon@gordian.com>
Wed, 4 Jan 2023 07:44:08 +0000
(07:44 +0000)
committer
Matthias Klose
<doko@debian.org>
Wed, 4 Jan 2023 07:44:08 +0000
(07:44 +0000)
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 a5bc2de3648135e2a304041b169c7c1d827f1b87..c55cc1f5116fc6beaab4973720cab7462cb5e221 100644
(file)
--- a/
bfd/opncls.c
+++ b/
bfd/opncls.c
@@
-222,6
+222,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)