mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-20 06:36:16 +00:00
LibFileSystem: Ignore ENOTSUP when using chown and chmod during copy
With FAT write support copying the file would show two errors because it does not support chown and chmod and would return ENOTSUP. After this commit these errors are ignored in that case.
This commit is contained in:
@@ -223,10 +223,14 @@ ErrorOr<void> copy_file(StringView destination_path, StringView source_path, str
|
||||
if (!has_flag(preserve_mode, PreserveMode::Permissions))
|
||||
my_umask |= 06000;
|
||||
|
||||
TRY(Core::System::fchmod(destination->fd(), source_stat.st_mode & ~my_umask));
|
||||
if (auto result = Core::System::fchmod(destination->fd(), source_stat.st_mode & ~my_umask); result.is_error())
|
||||
if (result.error().is_errno() && result.error().code() != ENOTSUP)
|
||||
return result.release_error();
|
||||
|
||||
if (has_flag(preserve_mode, PreserveMode::Ownership))
|
||||
TRY(Core::System::fchown(destination->fd(), source_stat.st_uid, source_stat.st_gid));
|
||||
if (auto result = Core::System::fchown(destination->fd(), source_stat.st_uid, source_stat.st_gid); result.is_error())
|
||||
if (result.error().is_errno() && result.error().code() != ENOTSUP)
|
||||
return result.release_error();
|
||||
|
||||
if (has_flag(preserve_mode, PreserveMode::Timestamps)) {
|
||||
struct timespec times[2] = {
|
||||
|
||||
Reference in New Issue
Block a user