mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
DisplayServer (Linux): don't return success if no devices are successfully connected
This commit is contained in:
@@ -231,6 +231,7 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result) {
|
||||
return "drmGetDevices() failed";
|
||||
}
|
||||
|
||||
int nSuccess = 0;
|
||||
FF_STRBUF_AUTO_DESTROY name = ffStrbufCreate();
|
||||
|
||||
for (int iDev = 0; iDev < nDevices; ++iDev) {
|
||||
@@ -261,6 +262,8 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result) {
|
||||
continue;
|
||||
}
|
||||
|
||||
++nSuccess;
|
||||
|
||||
for (int iConn = 0; iConn < res->count_connectors; ++iConn) {
|
||||
drmModeConnector* conn = ffdrmModeGetConnectorCurrent(primaryFd, res->connectors[iConn]);
|
||||
if (!conn) {
|
||||
@@ -415,7 +418,7 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result) {
|
||||
|
||||
ffdrmFreeDevices(devices, nDevices);
|
||||
|
||||
return NULL;
|
||||
return nSuccess > 0 ? NULL : "No DRM devices succeeded to connect";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user