mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
refactor: rename mch_get_acl => os_get_acl
This commit is contained in:
parent
614d382621
commit
a5207304dd
@ -2560,7 +2560,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
|
|||||||
#ifdef HAVE_ACL
|
#ifdef HAVE_ACL
|
||||||
// For systems that support ACL: get the ACL from the original file.
|
// For systems that support ACL: get the ACL from the original file.
|
||||||
if (!newfile) {
|
if (!newfile) {
|
||||||
acl = mch_get_acl((char_u *)fname);
|
acl = os_get_acl((char_u *)fname);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2800,7 +2800,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
|
|||||||
(double)file_info_old.stat.st_mtim.tv_sec);
|
(double)file_info_old.stat.st_mtim.tv_sec);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ACL
|
#ifdef HAVE_ACL
|
||||||
mch_set_acl((char_u *)backup, acl);
|
os_set_acl((char_u *)backup, acl);
|
||||||
#endif
|
#endif
|
||||||
SET_ERRMSG(NULL);
|
SET_ERRMSG(NULL);
|
||||||
break;
|
break;
|
||||||
@ -3336,7 +3336,7 @@ restore_backup:
|
|||||||
// Probably need to set the ACL before changing the user (can't set the
|
// Probably need to set the ACL before changing the user (can't set the
|
||||||
// ACL on a file the user doesn't own).
|
// ACL on a file the user doesn't own).
|
||||||
if (!backup_copy) {
|
if (!backup_copy) {
|
||||||
mch_set_acl((char_u *)wfname, acl);
|
os_set_acl((char_u *)wfname, acl);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -3552,7 +3552,7 @@ nofail:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ACL
|
#ifdef HAVE_ACL
|
||||||
mch_free_acl(acl);
|
os_free_acl(acl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (errmsg != NULL) {
|
if (errmsg != NULL) {
|
||||||
@ -4591,12 +4591,12 @@ int vim_rename(const char *from, const char *to)
|
|||||||
perm = os_getperm(from);
|
perm = os_getperm(from);
|
||||||
#ifdef HAVE_ACL
|
#ifdef HAVE_ACL
|
||||||
// For systems that support ACL: get the ACL from the original file.
|
// For systems that support ACL: get the ACL from the original file.
|
||||||
acl = mch_get_acl((char_u *)from);
|
acl = os_get_acl((char_u *)from);
|
||||||
#endif
|
#endif
|
||||||
fd_in = os_open((char *)from, O_RDONLY, 0);
|
fd_in = os_open((char *)from, O_RDONLY, 0);
|
||||||
if (fd_in < 0) {
|
if (fd_in < 0) {
|
||||||
#ifdef HAVE_ACL
|
#ifdef HAVE_ACL
|
||||||
mch_free_acl(acl);
|
os_free_acl(acl);
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -4607,7 +4607,7 @@ int vim_rename(const char *from, const char *to)
|
|||||||
if (fd_out < 0) {
|
if (fd_out < 0) {
|
||||||
close(fd_in);
|
close(fd_in);
|
||||||
#ifdef HAVE_ACL
|
#ifdef HAVE_ACL
|
||||||
mch_free_acl(acl);
|
os_free_acl(acl);
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -4619,7 +4619,7 @@ int vim_rename(const char *from, const char *to)
|
|||||||
close(fd_out);
|
close(fd_out);
|
||||||
close(fd_in);
|
close(fd_in);
|
||||||
#ifdef HAVE_ACL
|
#ifdef HAVE_ACL
|
||||||
mch_free_acl(acl);
|
os_free_acl(acl);
|
||||||
#endif
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -4644,8 +4644,8 @@ int vim_rename(const char *from, const char *to)
|
|||||||
os_setperm((const char *)to, perm);
|
os_setperm((const char *)to, perm);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ACL
|
#ifdef HAVE_ACL
|
||||||
mch_set_acl((char_u *)to, acl);
|
os_set_acl((char_u *)to, acl);
|
||||||
mch_free_acl(acl);
|
os_free_acl(acl);
|
||||||
#endif
|
#endif
|
||||||
if (errmsg != NULL) {
|
if (errmsg != NULL) {
|
||||||
semsg(errmsg, to);
|
semsg(errmsg, to);
|
||||||
|
@ -19,21 +19,21 @@
|
|||||||
|
|
||||||
// Return a pointer to the ACL of file "fname" in allocated memory.
|
// Return a pointer to the ACL of file "fname" in allocated memory.
|
||||||
// Return NULL if the ACL is not available for whatever reason.
|
// Return NULL if the ACL is not available for whatever reason.
|
||||||
vim_acl_T mch_get_acl(const char_u *fname)
|
vim_acl_T os_get_acl(const char_u *fname)
|
||||||
{
|
{
|
||||||
vim_acl_T ret = NULL;
|
vim_acl_T ret = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the ACL of file "fname" to "acl" (unless it's NULL).
|
// Set the ACL of file "fname" to "acl" (unless it's NULL).
|
||||||
void mch_set_acl(const char_u *fname, vim_acl_T aclent)
|
void os_set_acl(const char_u *fname, vim_acl_T aclent)
|
||||||
{
|
{
|
||||||
if (aclent == NULL) {
|
if (aclent == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mch_free_acl(vim_acl_T aclent)
|
void os_free_acl(vim_acl_T aclent)
|
||||||
{
|
{
|
||||||
if (aclent == NULL) {
|
if (aclent == NULL) {
|
||||||
return;
|
return;
|
||||||
|
@ -1343,9 +1343,9 @@ write_error:
|
|||||||
#ifdef HAVE_ACL
|
#ifdef HAVE_ACL
|
||||||
if (buf->b_ffname != NULL) {
|
if (buf->b_ffname != NULL) {
|
||||||
// For systems that support ACL: get the ACL from the original file.
|
// For systems that support ACL: get the ACL from the original file.
|
||||||
vim_acl_T acl = mch_get_acl((char_u *)buf->b_ffname);
|
vim_acl_T acl = os_get_acl((char_u *)buf->b_ffname);
|
||||||
mch_set_acl((char_u *)file_name, acl);
|
os_set_acl((char_u *)file_name, acl);
|
||||||
mch_free_acl(acl);
|
os_free_acl(acl);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user