kdrive/fbdev: Try the /dev/fb symlink first

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
This commit is contained in:
stefan11111 2026-05-28 19:10:09 +03:00 • committed by Enrico Weigelt
commit d2c26a5be0

View file

@ -51,8 +51,9 @@ fbdevInitialize(KdCardInfo * card, FbdevPriv * priv)
card->mynum, config->fbdevDevicePath);
} else {
char devbuf[] = "/dev/fbxx";
priv->fd = -1;
for (int i = 0; i < 32 && priv->fd < 0; i++) {
memcpy(devbuf, "/dev/fb", sizeof("/dev/fb"));
priv->fd = open("/dev/fb", O_RDWR);
for (int i = 0; i < 32 && (priv->fd < 0); i++) {
snprintf(devbuf, sizeof(devbuf),
"/dev/fb%d", i);
priv->fd = open(devbuf, O_RDWR);