mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-04-07 03:10:15 -04:00
sys-apps/coolercontrold: backport musl fix
Needed to build it on musl until 2.2.2 is released: https://gitlab.com/coolercontrol/coolercontrol/-/merge_requests/327 Signed-off-by: Charlie Quinet <w.iron.zombie@gmail.com>
This commit is contained in:
@@ -47,6 +47,7 @@ QA_FLAGS_IGNORED=".*"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/coolercontrold-2.1.0-optional-libdrm_amdgpu.patch
|
||||
"${FILESDIR}"/coolercontrold-2.2.0-backport-musl_fix.patch
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
diff --git a/coolercontrold/src/repositories/hwmon/drivetemp.rs b/coolercontrold/src/repositories/hwmon/drivetemp.rs
|
||||
index f49a8251..30d36a61 100644
|
||||
--- a/coolercontrold/src/repositories/hwmon/drivetemp.rs
|
||||
+++ b/coolercontrold/src/repositories/hwmon/drivetemp.rs
|
||||
@@ -149,10 +149,10 @@ async fn drive_power_state(dev_path: &Path) -> Result<PowerState> {
|
||||
// low level kernel ioctl
|
||||
unsafe {
|
||||
query[0] = ATA_CHECKPOWERMODE;
|
||||
- if libc::ioctl(fd, IOCTL_DRIVE_CMD, query.as_mut_ptr()) != 0 {
|
||||
+ if libc::ioctl(fd, IOCTL_DRIVE_CMD.try_into()?, query.as_mut_ptr()) != 0 {
|
||||
// Try the retired command if the current one failed
|
||||
query[0] = ATA_CHECKPOWERMODE_RETIRED;
|
||||
- if libc::ioctl(fd, IOCTL_DRIVE_CMD, query.as_mut_ptr()) != 0 {
|
||||
+ if libc::ioctl(fd, IOCTL_DRIVE_CMD.try_into()?, query.as_mut_ptr()) != 0 {
|
||||
return Err(anyhow!("Not a Block Device File"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user