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:
parent
105f741131
commit
bdc028da1c
Notes:
sideshowbarker
2024-07-17 22:33:53 +09:00
Author: https://github.com/PerikiyoXD Commit: https://github.com/SerenityOS/serenity/commit/bdc028da1c2 Pull-request: https://github.com/SerenityOS/serenity/pull/11326
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue