From: Matthias Klose Date: Sat, 27 Jul 2019 14:58:37 +0000 (+0100) Subject: _better_file_error X-Git-Tag: archive/raspbian/2.32.51.20190727-1+rpi1^2~18 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=abd84ef21074caa1ca51d7ecbcb9520be981188a;p=binutils.git _better_file_error directory. (#45832) Gbp-Pq: Name 006_better_file_error.patch --- diff --git a/bfd/opncls.c b/bfd/opncls.c index b8cda411e..8710127a5 100644 --- 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)