readlink: Use eprintf() to report errors
This commit is contained in:
parent
a29d31e94b
commit
6d4a7989cd
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user