readlink: Use eprintf() to report errors

This commit is contained in:
sin 2015-02-11 11:58:02 +00:00
parent a29d31e94b
commit 6d4a7989cd

View File

@ -83,14 +83,14 @@ mdone:
break;
case 'e':
if (stat(argv[0], &st) < 0)
exit(1);
eprintf("stat %s:", argv[0]);
case 'f':
if (!realpath(argv[0], b))
exit(1);
eprintf("realpath %s:", argv[0]);
break;
default:
if ((n = readlink(argv[0], b, PATH_MAX - 1)) < 0)
exit(1);
eprintf("readlink %s:", argv[0]);
b[n] = '\0';
}
printf("%s", b);