summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm/ecore_drm_tty.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-07-17 14:47:02 -0400
committerChris Michael <cp.michael@samsung.com>2014-07-17 14:47:02 -0400
commitff5bac5e6e38cde53f5e008e58f78d0efdc1dc3c (patch)
treeef6ee963b0df604eb29fbdfb34c340e4aa5508a4 /src/lib/ecore_drm/ecore_drm_tty.c
parentd1c583d30cda58a5eecd685be568a254078d173d (diff)
ecore-drm: Fix trapping of SIGUSR1 for VT switching signals
SIGUSR1 is used here to catch VT switching and either acquire or release the VT. The problem is that XWayland Also sends SIGUSR1 when it has finished initializing. In order to not get confused about where the SIGUSR1 came from we can check the pid inside the siginfo structure and see if it matches. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm/ecore_drm_tty.c')
-rw-r--r--src/lib/ecore_drm/ecore_drm_tty.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_tty.c b/src/lib/ecore_drm/ecore_drm_tty.c
index b100bf6db9..1bc7ffffe4 100644
--- a/src/lib/ecore_drm/ecore_drm_tty.c
+++ b/src/lib/ecore_drm/ecore_drm_tty.c
@@ -17,11 +17,13 @@ _ecore_drm_tty_cb_signal(void *data, int type EINA_UNUSED, void *event)
17{ 17{
18 Ecore_Drm_Device *dev; 18 Ecore_Drm_Device *dev;
19 Ecore_Event_Signal_User *ev; 19 Ecore_Event_Signal_User *ev;
20 siginfo_t sigdata;
20 21
21 dev = data; 22 dev = data;
22 ev = event; 23 ev = event;
23 24
24 DBG("Caught user signal: %d", ev->number); 25 sigdata = ev->data;
26 if (sigdata.si_pid != getpid()) return ECORE_CALLBACK_RENEW;
25 27
26 if (ev->number == 1) 28 if (ev->number == 1)
27 { 29 {
@@ -83,7 +85,7 @@ _ecore_drm_tty_cb_signal(void *data, int type EINA_UNUSED, void *event)
83 ERR("Could not acquire VT: %m"); 85 ERR("Could not acquire VT: %m");
84 } 86 }
85 87
86 return EINA_TRUE; 88 return ECORE_CALLBACK_RENEW;
87} 89}
88 90
89static Eina_Bool 91static Eina_Bool