summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerikiyoXD <perikiyoxd@gmail.com>2021-12-20 04:22:26 +0100
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-12-20 10:40:02 -0800
commitbdc028da1c2886ae2e168da14acea2ecdab15529 (patch)
treed8b9075c46aea252a828500e5fb313808ee94b97
parent105f741131f345aea5c737c58dc5bd1dfd2ff363 (diff)
downloadserenity-bdc028da1c2886ae2e168da14acea2ecdab15529.zip
cp: Print proper error message with strerror
When cp fails, now it prints an error string (strerror) instead of an error code.
-rw-r--r--Userland/Utilities/cp.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Utilities/cp.cpp b/Userland/Utilities/cp.cpp
index 930807a77b..ce53476eca 100644
--- a/Userland/Utilities/cp.cpp
+++ b/Userland/Utilities/cp.cpp
@@ -57,7 +57,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (result.error().tried_recursing)
warnln("cp: -R not specified; omitting directory '{}'", source);
else
- warnln("cp: unable to copy '{}' to '{}': {}", source, destination_path, static_cast<Error const&>(result.error()));
+ warnln("cp: unable to copy '{}' to '{}': {}", source, destination_path, strerror(result.error().code()));
return 1;
}