aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/native/drm_gbm_legacy.c
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-12-05 22:31:51 +0100
committerSven Gothel <[email protected]>2019-12-05 22:31:51 +0100
commitc317985db39f840f6edf9860487c604e6e31c2ba (patch)
tree304486ec789d2aa91362c7d6d80681f33a3b8aa7 /src/newt/native/drm_gbm_legacy.c
parentd693425e2e74a5e4a80c3fde552ffc7d757330f1 (diff)
Bug 1409: GNU/Linux DRM Console: Clear stdin before exit and don't act on stdin in vsync-wait-loop
User input during test from the console will also end up in stdin of the console after the java application has been closed. This is not only annoying, but also a security concern, as the input gets executed if containing a CR. Further, the vsync-wait-loop shall ignore stdin.
Diffstat (limited to 'src/newt/native/drm_gbm_legacy.c')
-rw-r--r--src/newt/native/drm_gbm_legacy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/newt/native/drm_gbm_legacy.c b/src/newt/native/drm_gbm_legacy.c
index 1aa8d5f82..cec3297a8 100644
--- a/src/newt/native/drm_gbm_legacy.c
+++ b/src/newt/native/drm_gbm_legacy.c
@@ -286,7 +286,9 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_egl_gbm_WindowDriver_NextSwapSur
while (waiting_for_flip) {
FD_ZERO(&fds);
- FD_SET(0, &fds);
+#if 0
+ FD_SET(0, &fds); // STDIN_FILENO: We don't want to listen to
+#endif
FD_SET(drmFd, &fds);
ret = select(drmFd + 1, &fds, NULL, NULL, NULL);
@@ -296,9 +298,10 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_egl_gbm_WindowDriver_NextSwapSur
} else if (ret == 0) {
ERR_PRINT("drm.select: select timeout!\n");
return -1;
+#if 0
} else if (FD_ISSET(0, &fds)) {
- ERR_PRINT("drm.select: user interrupted!\n");
- return 0;
+ DBG_PRINT("drm.select: stdin carriage return pressed!\n");
+#endif
}
drmHandleEvent(drmFd, &drm_event_ctx);
}