Skip to content

Commit

Permalink
DisplayServer (Linux): test for status instead of enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
CarterLi committed Dec 16, 2023
1 parent 10e1753 commit 8fa073b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/detection/displayserver/linux/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ static const char* drmParseSysfs(FFDisplayServerResult* result)
ffStrbufAppendS(&drmDir, entry->d_name);
uint32_t drmDirWithDnameLength = drmDir.length;

ffStrbufAppendS(&drmDir, "/enabled");
char enabled = 'd'; // disabled
ffReadFileData(drmDir.chars, sizeof(enabled), &enabled);
if (enabled != 'e') // enabled
ffStrbufAppendS(&drmDir, "/status");
char status = 'd'; // disconnected
ffReadFileData(drmDir.chars, sizeof(status), &status);
if (status != 'c') // connected
{
ffStrbufSubstrBefore(&drmDir, drmDirLength);
continue;
Expand Down Expand Up @@ -329,7 +329,7 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result)
const char* connectorTypeName = drmType2Name(conn->connector_type);
if (connectorTypeName == NULL)
connectorTypeName = "Unknown";
ffStrbufSetF(&name, "%s-%d", connectorTypeName, iConn);
ffStrbufSetF(&name, "%s-%d", connectorTypeName, iConn + 1);
}

ffdsAppendDisplay(result,
Expand Down

0 comments on commit 8fa073b

Please sign in to comment.