xfree86: fix readlink call
Misplaced parenthesis caused us to compare the sizeof, not the readlink return
value.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit bd5fe7593f
)
This commit is contained in:
parent
2a0c6c15c3
commit
cfc3dec09e
|
@ -336,7 +336,7 @@ fbdev_open(int scrnIndex, const char *dev, char **namep)
|
||||||
char *node = strrchr(dev, '/') + 1;
|
char *node = strrchr(dev, '/') + 1;
|
||||||
|
|
||||||
if (asprintf(&sysfs_path, "/sys/class/graphics/%s", node) < 0 ||
|
if (asprintf(&sysfs_path, "/sys/class/graphics/%s", node) < 0 ||
|
||||||
readlink(sysfs_path, buf, sizeof(buf) < 0) ||
|
readlink(sysfs_path, buf, sizeof(buf)) < 0 ||
|
||||||
strstr(buf, "devices/pci")) {
|
strstr(buf, "devices/pci")) {
|
||||||
free(sysfs_path);
|
free(sysfs_path);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
Loading…
Reference in New Issue