cp: Print proper error message with strerror

When cp fails, now it prints an error string (strerror)
instead of an error code.
This commit is contained in:
PerikiyoXD 2021-12-20 04:22:26 +01:00 committed by Brian Gianforcaro
parent 105f741131
commit bdc028da1c
Notes: sideshowbarker 2024-07-17 22:33:53 +09:00

View file

@ -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;
}