diff options
author | marha <marha@users.sourceforge.net> | 2012-05-25 15:31:52 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-05-25 15:31:52 +0200 |
commit | e37e5c7e6678395a7f5dff1aea1c240a5b1c8f66 (patch) | |
tree | 9e46ba338311cb6658589a7767ebcb7f525eb369 /xorg-server/config | |
parent | aebbd673a0fb4d5e9ae4e8e690b29fb364376875 (diff) | |
parent | eef864d36de97903007f04fad9fa43afe297745b (diff) | |
download | vcxsrv-e37e5c7e6678395a7f5dff1aea1c240a5b1c8f66.tar.gz vcxsrv-e37e5c7e6678395a7f5dff1aea1c240a5b1c8f66.tar.bz2 vcxsrv-e37e5c7e6678395a7f5dff1aea1c240a5b1c8f66.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'xorg-server/config')
-rw-r--r-- | xorg-server/config/config-backends.h | 1 | ||||
-rw-r--r-- | xorg-server/config/config.c | 9 | ||||
-rw-r--r-- | xorg-server/config/udev.c | 16 |
3 files changed, 22 insertions, 4 deletions
diff --git a/xorg-server/config/config-backends.h b/xorg-server/config/config-backends.h index e5622d51e..62abc0a5f 100644 --- a/xorg-server/config/config-backends.h +++ b/xorg-server/config/config-backends.h @@ -33,6 +33,7 @@ void remove_devices(const char *backend, const char *config_info); BOOL device_is_duplicate(const char *config_info); #ifdef CONFIG_UDEV +int config_udev_pre_init(void); int config_udev_init(void); void config_udev_fini(void); #else diff --git a/xorg-server/config/config.c b/xorg-server/config/config.c index 2b96dbb74..24e7ba7a0 100644 --- a/xorg-server/config/config.c +++ b/xorg-server/config/config.c @@ -33,6 +33,15 @@ #include "config-backends.h" void +config_pre_init(void) +{ +#ifdef CONFIG_UDEV + if (!config_udev_pre_init()) + ErrorF("[config] failed to pre-init udev\n"); +#endif +} + +void config_init(void) { #ifdef CONFIG_UDEV diff --git a/xorg-server/config/udev.c b/xorg-server/config/udev.c index 8b3ca0475..1995184f3 100644 --- a/xorg-server/config/udev.c +++ b/xorg-server/config/udev.c @@ -281,15 +281,14 @@ block_handler(pointer data, struct timeval **tv, pointer read_mask) } int -config_udev_init(void) +config_udev_pre_init(void) { struct udev *udev; - struct udev_enumerate *enumerate; - struct udev_list_entry *devices, *device; udev = udev_new(); if (!udev) return 0; + udev_monitor = udev_monitor_new_from_netlink(udev, "udev"); if (!udev_monitor) return 0; @@ -302,12 +301,21 @@ config_udev_init(void) if (SeatId && strcmp(SeatId, "seat0")) udev_monitor_filter_add_match_tag(udev_monitor, SeatId); #endif - if (udev_monitor_enable_receiving(udev_monitor)) { ErrorF("config/udev: failed to bind the udev monitor\n"); return 0; } + return 1; +} +int +config_udev_init(void) +{ + struct udev *udev; + struct udev_enumerate *enumerate; + struct udev_list_entry *devices, *device; + + udev = udev_monitor_get_udev(udev_monitor); enumerate = udev_enumerate_new(udev); if (!enumerate) return 0; |