readlink: Use eprintf() to report errors
This commit is contained in:
parent
a29d31e94b
commit
6d4a7989cd
|
@ -83,14 +83,14 @@ mdone:
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
if (stat(argv[0], &st) < 0)
|
if (stat(argv[0], &st) < 0)
|
||||||
exit(1);
|
eprintf("stat %s:", argv[0]);
|
||||||
case 'f':
|
case 'f':
|
||||||
if (!realpath(argv[0], b))
|
if (!realpath(argv[0], b))
|
||||||
exit(1);
|
eprintf("realpath %s:", argv[0]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if ((n = readlink(argv[0], b, PATH_MAX - 1)) < 0)
|
if ((n = readlink(argv[0], b, PATH_MAX - 1)) < 0)
|
||||||
exit(1);
|
eprintf("readlink %s:", argv[0]);
|
||||||
b[n] = '\0';
|
b[n] = '\0';
|
||||||
}
|
}
|
||||||
printf("%s", b);
|
printf("%s", b);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user