VirtualBox

Changeset 63556 in vbox for trunk/src/VBox/Additions/x11


Ignore:
Timestamp:
Aug 16, 2016 1:32:05 PM (8 years ago)
Author:
vboxsync
Message:

bugref:8087: Additions/x11: support non-root X server: improve check for kernel driver in vboxvideo X server driver so that it also works on NetBSD (and is more reliable elsewhere).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r63369 r63556  
    9494# include <stdlib.h>
    9595# include <string.h>
    96 # include <sys/stat.h>
    97 # define xf86stat stat
    98 # define xf86stat_s stat
    99 #else
    100 # include <xf86_ansic.h>
     96# include <fcntl.h>
     97# include <unistd.h>
    10198#endif
    10299
     
    739736{
    740737    ScrnInfoPtr pScrn;
    741     struct xf86stat_s sstat;
     738    int drmFd;
    742739
    743740    TRACE_ENTRY();
    744741
    745     if (xf86stat("/dev/dri/card0", &sstat) == 0)
     742    drmFd = open("/dev/dri/card0", O_RDWR, 0);
     743    if (drmFd >= 0)
    746744    {
    747745        xf86Msg(X_INFO, "vboxvideo: kernel driver found, not loading.\n");
     746        close(drmFd);
    748747        return FALSE;
    749748    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette