diff --git a/gnu/dist/binutils/binutils/bucomm.c b/gnu/dist/binutils/binutils/bucomm.c index 6573e2d9c7fa..54daea86c96c 100644 --- a/gnu/dist/binutils/binutils/bucomm.c +++ b/gnu/dist/binutils/binutils/bucomm.c @@ -469,7 +469,14 @@ get_file_size (const char * file_name) file_name, strerror (errno)); } else if (! S_ISREG (statbuf.st_mode)) - non_fatal (_("Warning: '%s' is not an ordinary file"), file_name); + { + if (!S_ISCHR(statbuf.st_mode)) + { + non_fatal (_("Warning: '%s' is not an ordinary file"), file_name); + return 0; + } + return statbuf.st_size ? statbuf.st_size : 1; + } else return statbuf.st_size;