weston-launch: Print explanation of why we failed to open the device
This commit is contained in:
committed by
Kristian Høgsberg
parent
2f8d9aacfa
commit
d33f2b065c
+6
-1
@@ -320,12 +320,17 @@ handle_open(struct weston_launch *wl, struct msghdr *msg, ssize_t len)
|
|||||||
goto err0;
|
goto err0;
|
||||||
|
|
||||||
fd = open(message->path, message->flags);
|
fd = open(message->path, message->flags);
|
||||||
if (fd < 0)
|
if (fd < 0) {
|
||||||
|
fprintf(stderr, "Error opening device %s: %m\n",
|
||||||
|
message->path);
|
||||||
goto err0;
|
goto err0;
|
||||||
|
}
|
||||||
|
|
||||||
if (major(s.st_rdev) != INPUT_MAJOR) {
|
if (major(s.st_rdev) != INPUT_MAJOR) {
|
||||||
close(fd);
|
close(fd);
|
||||||
fd = -1;
|
fd = -1;
|
||||||
|
fprintf(stderr, "Device %s is not an input device\n",
|
||||||
|
message->path);
|
||||||
goto err0;
|
goto err0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user