Don't be pedantic about requiring things to be ordinary files. Handle

character special devices specially so that eg. nm /dev/ksyms works.
This commit is contained in:
christos 2005-05-16 03:24:44 +00:00
parent a790d15184
commit 25a293877a

View File

@ -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;