mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-04 20:24:19 +01:00
Common: improves reliability of FF_DEBUG
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#define INITGUID
|
||||
|
||||
#include "battery.h"
|
||||
#include "common/endian.h"
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/endian.h"
|
||||
#include "common/mallocHelper.h"
|
||||
#include "common/windows/nt.h"
|
||||
#include "common/windows/unicode.h"
|
||||
#include "common/windows/wmi.h"
|
||||
|
||||
|
||||
@@ -60,8 +60,7 @@
|
||||
snprintf(path, sizeof(path), "/dev/i2c-%d", cache->devices[i]);
|
||||
FF_AUTO_CLOSE_FD int fd = open(path, O_RDWR | O_CLOEXEC);
|
||||
if (fd < 0) {
|
||||
int error = errno;
|
||||
FF_DEBUG("Brightness DDC/CI: cached bus %d is unavailable (errno=%d: %s)", cache->devices[i], error, strerror(error));
|
||||
FF_DEBUG("Brightness DDC/CI: cached bus %d is unavailable (errno=%d: %s)", cache->devices[i], errno, strerror(errno));
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
@@ -119,8 +118,7 @@
|
||||
|
||||
int ioctlResult = ioctl(fd, I2C_RDWR, &data);
|
||||
if (ioctlResult != 1) {
|
||||
int error = errno;
|
||||
FF_DEBUG("Brightness DDC/CI: write request failed (fd=%d, result=%d, errno=%d: %s)", fd, ioctlResult, error, strerror(error));
|
||||
FF_DEBUG("Brightness DDC/CI: write request failed (fd=%d, result=%d, errno=%d: %s)", fd, ioctlResult, errno, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -131,8 +129,7 @@
|
||||
msg.buf = response;
|
||||
ioctlResult = ioctl(fd, I2C_RDWR, &data);
|
||||
if (ioctlResult != 1) {
|
||||
int error = errno;
|
||||
FF_DEBUG("Brightness DDC/CI: read response failed (fd=%d, result=%d, errno=%d: %s)", fd, ioctlResult, error, strerror(error));
|
||||
FF_DEBUG("Brightness DDC/CI: read response failed (fd=%d, result=%d, errno=%d: %s)", fd, ioctlResult, errno, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user