File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ FF_MAYBE_UNUSED static const char* detectByDrm(FFlist* results)
176176{
177177 const char * drmDirPath = "/sys/class/drm/" ;
178178
179- DIR * dirp = opendir (drmDirPath );
179+ FF_AUTO_CLOSE_DIR DIR * dirp = opendir (drmDirPath );
180180 if (dirp == NULL )
181181 return "opendir(drmDirPath) == NULL" ;
182182
@@ -232,23 +232,23 @@ FF_MAYBE_UNUSED static const char* detectByDrm(FFlist* results)
232232 ffStrbufSubstrBefore (& drmDir , drmDirLength );
233233 }
234234
235- closedir (dirp );
236235 return NULL ;
237236}
238237#endif // __linux__
239238
240239const char * ffDetectMonitor (FFlist * results )
241240{
242- const char * error = "Fastfetch was compiled without xrandr support" ;
241+ const char * error = NULL ;
242+
243+ #if defined(__linux__ )
244+ error = detectByDrm (results );
245+ if (!error && results -> length > 0 ) return NULL ;
246+ #endif
243247
244248 #ifdef FF_HAVE_XRANDR
245249 error = detectByXrandr (results );
246250 if (!error ) return NULL ;
247251 #endif
248252
249- #if defined(__linux__ )
250- error = detectByDrm (results );
251- #endif
252-
253- return error ;
253+ return "Fastfetch was compiled without xrandr support" ;
254254}
You can’t perform that action at this time.
0 commit comments