diff options
Diffstat (limited to 'hw/xfree86/os-support/linux')
-rw-r--r-- | hw/xfree86/os-support/linux/int10/linux.c | 6 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_agp.c | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/lnx_init.c | 1 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/systemd-logind.c | 7 |
4 files changed, 11 insertions, 5 deletions
diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c index 42f872dd2..62fdaa434 100644 --- a/hw/xfree86/os-support/linux/int10/linux.c +++ b/hw/xfree86/os-support/linux/int10/linux.c @@ -135,7 +135,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) } } - pInt = (xf86Int10InfoPtr) xnfcalloc(1, sizeof(xf86Int10InfoRec)); + pInt = (xf86Int10InfoPtr) XNFcallocarray(1, sizeof(xf86Int10InfoRec)); pInt->pScrn = pScrn; pInt->entityIndex = entityIndex; pInt->dev = xf86GetPciInfoForEntity(entityIndex); @@ -144,9 +144,9 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) goto error0; pInt->mem = &linuxMem; pagesize = getpagesize(); - pInt->private = (void *) xnfcalloc(1, sizeof(linuxInt10Priv)); + pInt->private = (void *) XNFcallocarray(1, sizeof(linuxInt10Priv)); ((linuxInt10Priv *) pInt->private)->alloc = - (void *) xnfcalloc(1, ALLOC_ENTRIES(pagesize)); + (void *) XNFcallocarray(1, ALLOC_ENTRIES(pagesize)); if (!xf86IsEntityPrimary(entityIndex)) { DebugF("Mapping high memory area\n"); diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c index c1bc6fac7..fd2a07f1b 100644 --- a/hw/xfree86/os-support/linux/lnx_agp.c +++ b/hw/xfree86/os-support/linux/lnx_agp.c @@ -133,7 +133,7 @@ xf86GetAGPInfo(int screenNum) if (!GARTInit(screenNum)) return NULL; - if ((info = calloc(sizeof(AgpInfo), 1)) == NULL) { + if ((info = calloc(1, sizeof(AgpInfo))) == NULL) { xf86DrvMsg(screenNum, X_ERROR, "xf86GetAGPInfo: Failed to allocate AgpInfo\n"); return NULL; diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index 16c3dc535..126371aeb 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -32,7 +32,6 @@ #include <X11/Xmd.h> #include "os/cmdline.h" -#include "os/osdep.h" #include "compiler.h" #include "linux.h" diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c index c6a24fc7b..689cb1b21 100644 --- a/hw/xfree86/os-support/linux/systemd-logind.c +++ b/hw/xfree86/os-support/linux/systemd-logind.c @@ -33,6 +33,7 @@ #include <unistd.h> #include "config/dbus-core.h" +#include "config/hotplug_priv.h" #include "os.h" #include "linux.h" @@ -397,6 +398,11 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data) dbus_error_free(&error); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } + + /* + * fd will be received via DBus if and only if pause == 0, so it + * only needs to be closed in that code path + */ } else return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; @@ -431,6 +437,7 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data) info->active = TRUE; if (pdev) { + close(fd); pdev->flags &= ~XF86_PDEV_PAUSED; } else systemd_logind_set_input_fd_for_all_devs(major, minor, fd, |