diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-25 14:39:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-25 14:39:00 +0800 |
commit | 7dd6fd422b16e97ef5352430031baac0c5afa022 (patch) | |
tree | c6af1ab9b8ff53e6ea6c5f26e66b2eda0a46433b /src | |
parent | 02d00cf3eed6681c6dde40585551c8243d7c003f (diff) | |
download | rneovim-7dd6fd422b16e97ef5352430031baac0c5afa022.tar.gz rneovim-7dd6fd422b16e97ef5352430031baac0c5afa022.tar.bz2 rneovim-7dd6fd422b16e97ef5352430031baac0c5afa022.zip |
refactor(backup): remove duplicate os_copy_xattr() (#28020)
The first os_copy_xattr() is inside #ifdef UNIX, while the second isn't,
so the first one isn't actually needed.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/bufwrite.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/nvim/bufwrite.c b/src/nvim/bufwrite.c index 15f30b84bf..27de03954a 100644 --- a/src/nvim/bufwrite.c +++ b/src/nvim/bufwrite.c @@ -913,24 +913,18 @@ static int buf_write_make_backup(char *fname, bool append, FileInfo *file_info_o os_setperm(*backupp, perm & 0777); #ifdef UNIX - // // Try to set the group of the backup same as the original file. If // this fails, set the protection bits for the group same as the // protection bits for others. - // if (file_info_new.stat.st_gid != file_info_old->stat.st_gid && os_chown(*backupp, (uv_uid_t)-1, (uv_gid_t)file_info_old->stat.st_gid) != 0) { os_setperm(*backupp, (perm & 0707) | ((perm & 07) << 3)); } - -# ifdef HAVE_XATTR - os_copy_xattr(fname, *backupp); -# endif - os_file_settime(*backupp, (double)file_info_old->stat.st_atim.tv_sec, (double)file_info_old->stat.st_mtim.tv_sec); #endif + os_set_acl(*backupp, acl); #ifdef HAVE_XATTR os_copy_xattr(fname, *backupp); |