pwdx: write errors to stderr
Includes also magic number removal (return value 1 to EXIT_FAILURE), and proper null assignment to end of string. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
741de935ef
commit
2c8b3a7857
4
pwdx.c
4
pwdx.c
@ -98,7 +98,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (len < 0) {
|
if (len < 0) {
|
||||||
s = strerror(errno == ENOENT ? ESRCH : errno);
|
s = strerror(errno == ENOENT ? ESRCH : errno);
|
||||||
retval = 1;
|
retval = EXIT_FAILURE;
|
||||||
|
fprintf(stderr, "%s: %s\n", argv[i], s);
|
||||||
|
continue;
|
||||||
} else {
|
} else {
|
||||||
pathbuf[len] = 0;
|
pathbuf[len] = 0;
|
||||||
s = pathbuf;
|
s = pathbuf;
|
||||||
|
Loading…
Reference in New Issue
Block a user