mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-07-29 11:33:43 +00:00
Run clippy fix
This commit is contained in:
parent
65d1c5827c
commit
b36066bbcd
@ -325,14 +325,13 @@ impl Utf8CStr {
|
|||||||
|
|
||||||
pub fn set_attr<'a>(&'a self, attr: &'a FileAttr) -> OsResult<'a, ()> {
|
pub fn set_attr<'a>(&'a self, attr: &'a FileAttr) -> OsResult<'a, ()> {
|
||||||
unsafe {
|
unsafe {
|
||||||
if !attr.is_symlink() {
|
if !attr.is_symlink() && libc::chmod(self.as_ptr(), (attr.st.st_mode & 0o777).as_()) < 0
|
||||||
if libc::chmod(self.as_ptr(), (attr.st.st_mode & 0o777).as_()) < 0 {
|
{
|
||||||
let self_attr = self.get_attr()?;
|
let self_attr = self.get_attr()?;
|
||||||
if !self_attr.is_symlink() {
|
if !self_attr.is_symlink() {
|
||||||
return Err(OsError::last_os_error("chmod", Some(self), None));
|
return Err(OsError::last_os_error("chmod", Some(self), None));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
libc::lchown(self.as_ptr(), attr.st.st_uid, attr.st.st_gid).check_os_err(
|
libc::lchown(self.as_ptr(), attr.st.st_uid, attr.st.st_gid).check_os_err(
|
||||||
"lchown",
|
"lchown",
|
||||||
Some(self),
|
Some(self),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user