summaryrefslogtreecommitdiffstats
path: root/kdesktop/lock/main.cc
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-04-08 15:13:08 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-04-08 15:13:08 -0500
commite80c2baea0319decdad80c3c98cc7b28a010b0f0 (patch)
treefe2e7a77c80f4d8031646f4256670b91ed53a3d8 /kdesktop/lock/main.cc
parent755776b6c4875dddd0fa2971845252274215d86a (diff)
downloadtdebase-e80c2baea0319decdad80c3c98cc7b28a010b0f0.tar.gz
tdebase-e80c2baea0319decdad80c3c98cc7b28a010b0f0.zip
Remove external dcop call and associated thread
Fix lockup on lock screen command due to signal race condition
Diffstat (limited to 'kdesktop/lock/main.cc')
-rw-r--r--kdesktop/lock/main.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc
index 79799d129..bafa02539 100644
--- a/kdesktop/lock/main.cc
+++ b/kdesktop/lock/main.cc
@@ -380,6 +380,7 @@ int main( int argc, char **argv )
kdesktop_pid = atoi(args->getOption( "internal" ));
while (signalled_run == FALSE) {
sigset_t new_mask;
+ sigset_t orig_mask;
struct sigaction act;
in_internal_mode = TRUE;
@@ -438,7 +439,11 @@ int main( int argc, char **argv )
app->processEvents();
// wait for SIGUSR1, SIGUSR2, SIGWINCH, SIGTTIN, or SIGTTOU
- sigsuspend(&new_mask);
+ sigprocmask(SIG_BLOCK, &new_mask, &orig_mask);
+ if (signalled_run != TRUE) {
+ sigsuspend(&orig_mask);
+ }
+ sigprocmask(SIG_UNBLOCK, &new_mask, NULL);
// Reenable reception of X11 events on the root window
XSelectInput( tqt_xdisplay(), tqt_xrootwin(), rootAttr.your_event_mask );