aboutsummaryrefslogtreecommitdiff
path: root/binutils/bucomm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-06-26 13:25:41 +0100
committerNick Clifton <nickc@redhat.com>2017-06-26 13:26:47 +0100
commit0602cdad745472ed2561d8096a4bb021c8d0301d (patch)
treea6b8702cf25fc021efe3b2ca038d6d97959e9d80 /binutils/bucomm.c
parenta3aea05a66ec325ddd19b0c8dbe504958a295cd3 (diff)
downloadgdb-0602cdad745472ed2561d8096a4bb021c8d0301d.zip
gdb-0602cdad745472ed2561d8096a4bb021c8d0301d.tar.gz
gdb-0602cdad745472ed2561d8096a4bb021c8d0301d.tar.bz2
Produce a consistent warning message when attempting to run a tool on a directory.
PR binutils/21659 * bucomm.c (get_file_size): Explicitly warn if the file is a directory.
Diffstat (limited to 'binutils/bucomm.c')
-rw-r--r--binutils/bucomm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/binutils/bucomm.c b/binutils/bucomm.c
index fd6f356..5a0b634 100644
--- a/binutils/bucomm.c
+++ b/binutils/bucomm.c
@@ -598,6 +598,8 @@ get_file_size (const char * file_name)
non_fatal (_("Warning: could not locate '%s'. reason: %s"),
file_name, strerror (errno));
}
+ else if (S_ISDIR (statbuf.st_mode))
+ non_fatal (_("Warning: '%s' is a directory"), file_name);
else if (! S_ISREG (statbuf.st_mode))
non_fatal (_("Warning: '%s' is not an ordinary file"), file_name);
else if (statbuf.st_size < 0)