mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-07 04:14:20 +00:00
xfree86: fbdevhw: drop 'mode' argument from open() calls
The 'mode' argument for open() is only used when files are created, and files aren't created here. Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
This commit is contained in:
committed by
Enrico Weigelt
parent
0c261e0104
commit
ca7a1e1e39
@@ -250,18 +250,18 @@ fbdev_open_pci(struct pci_device *pPci, char **namep)
|
||||
"/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics/fb%d",
|
||||
pPci->domain, pPci->bus, pPci->dev, pPci->func, i);
|
||||
|
||||
fd = open(filename, O_RDONLY, 0);
|
||||
fd = open(filename, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
snprintf(filename, sizeof(filename),
|
||||
"/sys/bus/pci/devices/%04x:%02x:%02x.%d/graphics:fb%d",
|
||||
pPci->domain, pPci->bus, pPci->dev, pPci->func, i);
|
||||
fd = open(filename, O_RDONLY, 0);
|
||||
fd = open(filename, O_RDONLY);
|
||||
}
|
||||
if (fd >= 0) {
|
||||
close(fd);
|
||||
snprintf(filename, sizeof(filename), "/dev/fb%d", i);
|
||||
|
||||
fd = open(filename, O_RDWR, 0);
|
||||
fd = open(filename, O_RDWR);
|
||||
if (fd != -1) {
|
||||
if (ioctl(fd, FBIOGET_FSCREENINFO, (void *) &fix) != -1) {
|
||||
if (namep) {
|
||||
@@ -316,15 +316,15 @@ fbdev_open(int scrnIndex, const char *dev, char **namep)
|
||||
|
||||
/* try argument (from XF86Config) first */
|
||||
if (dev) {
|
||||
fd = open(dev, O_RDWR, 0);
|
||||
fd = open(dev, O_RDWR);
|
||||
}
|
||||
else {
|
||||
/* second: environment variable */
|
||||
dev = getenv("FRAMEBUFFER");
|
||||
if ((NULL == dev) || ((fd = open(dev, O_RDWR, 0)) == -1)) {
|
||||
if ((NULL == dev) || ((fd = open(dev, O_RDWR)) == -1)) {
|
||||
/* last try: default device */
|
||||
dev = "/dev/fb0";
|
||||
fd = open(dev, O_RDWR, 0);
|
||||
fd = open(dev, O_RDWR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user