[PATCH weston] udev-seat: Fail input setup only if no devices are found

Rob Bradford robert.bradford at intel.com
Mon Jun 3 10:46:13 PDT 2013


From: Rob Bradford <rob at linux.intel.com>

Rather than failing if we cannot open any single device fail the input
setup if there are no input devices added.

https://bugs.freedesktop.org/show_bug.cgi?id=64506
---
 src/udev-seat.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/udev-seat.c b/src/udev-seat.c
index 7e62429..12a531c 100644
--- a/src/udev-seat.c
+++ b/src/udev-seat.c
@@ -58,7 +58,7 @@ device_added(struct udev_device *udev_device, struct udev_seat *master)
 	fd = weston_launcher_open(c, devnode, O_RDWR | O_NONBLOCK);
 	if (fd < 0) {
 		weston_log("opening input device '%s' failed.\n", devnode);
-		return -1;
+		return 0;
 	}
 
 	device = evdev_device_create(&master->base, devnode, fd);
@@ -69,7 +69,7 @@ device_added(struct udev_device *udev_device, struct udev_seat *master)
 	} else if (device == NULL) {
 		close(fd);
 		weston_log("failed to create input device '%s'.\n", devnode);
-		return -1;
+		return 0;
 	}
 
 	calibration_values =
@@ -140,6 +140,7 @@ udev_seat_add_devices(struct udev_seat *seat, struct udev *udev)
 			"\t- seats misconfigured "
 			"(Weston backend option 'seat', "
 			"udev device property ID_SEAT)\n");
+		return -1;
 	}
 
 	return 0;
-- 
1.8.1.4



More information about the wayland-devel mailing list