From: Michael Orlitzky Date: Thu, 1 Mar 2018 22:15:07 +0000 (-0500) Subject: Improve the error message for most types of inaccessible paths. X-Git-Tag: v0.2.0~15 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=45d4e8bba034c22c317fbd20c629589e35d97683;p=apply-default-acl.git Improve the error message for most types of inaccessible paths. --- diff --git a/run-tests.sh b/run-tests.sh index 3ac659f..3741430 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -672,14 +672,12 @@ compare # we get the expected error. TESTNUM=25 ACTUAL=$( "${BIN}" test/nonexistent 2>&1 ) -ACTUAL="${ACTUAL#*: }" EXPECTED="test/nonexistent: No such file or directory" compare # Same as the previous test, but with --recursive. TESTNUM=26 ACTUAL=$( "${BIN}" --recursive test/nonexistent 2>&1 ) -ACTUAL="${ACTUAL#*: }" EXPECTED="test/nonexistent: No such file or directory" compare @@ -690,7 +688,6 @@ DUMMY1="${TESTDIR}/dummy1" DUMMY2="${TESTDIR}/dummy2" touch "${DUMMY1}" "${DUMMY2}" ACTUAL=$( "${BIN}" "${DUMMY1}" test/nonexistent "${DUMMY2}" 2>&1 ) -ACTUAL="${ACTUAL#*: }" EXPECTED="test/nonexistent: No such file or directory" compare diff --git a/src/apply-default-acl.c b/src/apply-default-acl.c index 3350a19..a520aa9 100644 --- a/src/apply-default-acl.c +++ b/src/apply-default-acl.c @@ -257,7 +257,7 @@ int main(int argc, char* argv[]) { * typos, too. */ if (!path_accessible(target)) { - fprintf(stderr, "%s: %s: No such file or directory\n", argv[0], target); + perror(target); result = EXIT_FAILURE; continue; }