mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Global: replaces %m for %s + strerror(errno)
Not portable
This reverts aabab6dff5
This commit is contained in:
@@ -15,7 +15,7 @@ static const char* detectDnsFromConf(const char* path, FFDNSOptions* options, FF
|
||||
FF_AUTO_CLOSE_FILE FILE* file = fopen(path, "r");
|
||||
if (!file)
|
||||
{
|
||||
FF_DEBUG("Failed to open %s: %m", path);
|
||||
FF_DEBUG("Failed to open %s: %s", path, strerror(errno));
|
||||
return "fopen(path, r) failed";
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ static const char* detectDnsFromConf(const char* path, FFDNSOptions* options, FF
|
||||
FF_AUTO_CLOSE_FILE FILE* file = fopen(path, "r");
|
||||
if (!file)
|
||||
{
|
||||
FF_DEBUG("Failed to open %s: %m", path);
|
||||
FF_DEBUG("Failed to open %s: %s", path, strerror(errno));
|
||||
return "fopen(path, r) failed";
|
||||
}
|
||||
|
||||
|
||||
@@ -375,7 +375,7 @@ static const char* detectWifiWithIoctls(FFWifiResult* item)
|
||||
FF_AUTO_CLOSE_FD int sock = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
|
||||
if(sock < 0)
|
||||
{
|
||||
FF_DEBUG("Failed to create socket: %m");
|
||||
FF_DEBUG("Failed to create socket: %s", strerror(errno));
|
||||
return "socket() failed";
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ static const char* detectWifiWithIoctls(FFWifiResult* item)
|
||||
FF_DEBUG("SSID: %s", item->conn.ssid.chars);
|
||||
}
|
||||
else
|
||||
FF_DEBUG("Failed to get SSID via ioctl: %m");
|
||||
FF_DEBUG("Failed to get SSID via ioctl: %s", strerror(errno));
|
||||
|
||||
// Get protocol name
|
||||
FF_DEBUG("Getting protocol name via ioctl");
|
||||
@@ -408,7 +408,7 @@ static const char* detectWifiWithIoctls(FFWifiResult* item)
|
||||
FF_DEBUG("Protocol: %s", item->conn.protocol.chars);
|
||||
}
|
||||
else
|
||||
FF_DEBUG("Failed to get protocol name via ioctl: %m");
|
||||
FF_DEBUG("Failed to get protocol name via ioctl: %s", strerror(errno));
|
||||
|
||||
// Get BSSID
|
||||
FF_DEBUG("Getting BSSID via ioctl");
|
||||
@@ -420,7 +420,7 @@ static const char* detectWifiWithIoctls(FFWifiResult* item)
|
||||
FF_DEBUG("BSSID: %s", item->conn.bssid.chars);
|
||||
}
|
||||
else
|
||||
FF_DEBUG("Failed to get BSSID via ioctl: %m");
|
||||
FF_DEBUG("Failed to get BSSID via ioctl: %s", strerror(errno));
|
||||
|
||||
// Get bitrate
|
||||
FF_DEBUG("Getting bitrate via ioctl");
|
||||
@@ -430,7 +430,7 @@ static const char* detectWifiWithIoctls(FFWifiResult* item)
|
||||
FF_DEBUG("TX bitrate: %.2f Mbps", item->conn.txRate);
|
||||
}
|
||||
else
|
||||
FF_DEBUG("Failed to get bitrate via ioctl: %m");
|
||||
FF_DEBUG("Failed to get bitrate via ioctl: %s", strerror(errno));
|
||||
|
||||
// Get frequency/channel
|
||||
FF_DEBUG("Getting frequency via ioctl");
|
||||
@@ -460,7 +460,7 @@ static const char* detectWifiWithIoctls(FFWifiResult* item)
|
||||
}
|
||||
}
|
||||
else
|
||||
FF_DEBUG("Failed to get frequency via ioctl: %m");
|
||||
FF_DEBUG("Failed to get frequency via ioctl: %s", strerror(errno));
|
||||
|
||||
// Get signal strength
|
||||
FF_DEBUG("Getting signal stats via ioctl");
|
||||
@@ -476,7 +476,7 @@ static const char* detectWifiWithIoctls(FFWifiResult* item)
|
||||
FF_DEBUG("Signal level: %d dBm, quality: %.0f%%", level, item->conn.signalQuality);
|
||||
}
|
||||
else
|
||||
FF_DEBUG("Failed to get signal stats via ioctl: %m");
|
||||
FF_DEBUG("Failed to get signal stats via ioctl: %s", strerror(errno));
|
||||
|
||||
// Get security info
|
||||
FF_DEBUG("Getting security info via ioctl");
|
||||
@@ -515,7 +515,7 @@ static const char* detectWifiWithIoctls(FFWifiResult* item)
|
||||
}
|
||||
}
|
||||
else
|
||||
FF_DEBUG("Failed to get security info via ioctl: %m");
|
||||
FF_DEBUG("Failed to get security info via ioctl: %s", strerror(errno));
|
||||
|
||||
FF_DEBUG("ioctl wifi detection completed");
|
||||
return NULL;
|
||||
@@ -528,7 +528,7 @@ const char* ffDetectWifi(FF_MAYBE_UNUSED FFlist* result)
|
||||
struct if_nameindex* infs = if_nameindex();
|
||||
if(!infs)
|
||||
{
|
||||
FF_DEBUG("if_nameindex() failed: %m");
|
||||
FF_DEBUG("if_nameindex() failed: %s", strerror(errno));
|
||||
return "if_nameindex() failed";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user