bin2fex: better error message when input is not a regular file

This commit is contained in:
Alejandro Mery 2012-05-02 13:37:46 +02:00
parent 7ad2a5c360
commit 544b9e7882

View File

@ -67,7 +67,7 @@ int main(int argc, char *argv[])
if (fstat(fd[0], &sb) == -1)
errf("fstat: %s: %s\n", filename[0], strerror(errno));
else if (!S_ISREG(sb.st_mode))
errf("%s: %s\n", filename[0], strerror(errno));
errf("%s: not a regular file (mode:%d).\n", filename[0], sb.st_mode);
else if ((p = mmap(0, sb.st_size, PROT_READ, MAP_SHARED, fd[0], 0)) == MAP_FAILED)
errf("mmap: %s: %s\n", filename[0], strerror(errno));
else {