From: Matthias Klose Date: Sun, 8 Apr 2018 20:55:34 +0000 (+0100) Subject: _better_file_error X-Git-Tag: archive/raspbian/2.30-15+rpi1^2~30 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6351d1e141fc3491e1fc134af02730722db44f1d;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 458f06ea7..709689057 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)