summaryrefslogtreecommitdiffstats
path: root/kdm
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-03-03 15:26:35 -0600
committerSlávek Banko <slavek.banko@axis.cz>2012-06-03 03:26:55 +0200
commit497b2f091165679f85baac76a99a65a80b40ab68 (patch)
treeaaf7ecac747fb8fd4dcbf2e3420d00c2b334cfa5 /kdm
parent2482dd05e5b7806b4bad69ac8e07dbc4dd6714e0 (diff)
downloadtdebase-497b2f091165679f85baac76a99a65a80b40ab68.tar.gz
tdebase-497b2f091165679f85baac76a99a65a80b40ab68.zip
Fix high tdm CPU usage when the SAK is enabled
This closes Bug 690 (cherry picked from commit 5486d8e2a8ed86dc1fa421a46b4e3cd8b796e1ea)
Diffstat (limited to 'kdm')
-rw-r--r--kdm/kfrontend/kgreeter.cpp8
-rw-r--r--kdm/kfrontend/sakdlg.cc11
2 files changed, 19 insertions, 0 deletions
diff --git a/kdm/kfrontend/kgreeter.cpp b/kdm/kfrontend/kgreeter.cpp
index 07e9e3f70..649def4e6 100644
--- a/kdm/kfrontend/kgreeter.cpp
+++ b/kdm/kfrontend/kgreeter.cpp
@@ -83,6 +83,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <sys/time.h>
#include <termios.h>
#include <signal.h>
+#include <libgen.h>
#include <X11/Xlib.h>
@@ -250,6 +251,13 @@ void KGreeter::handleInputPipe(void) {
umask(0);
struct stat buffer;
int status;
+ char *fifo_parent_dir = strdup(FIFO_DIR);
+ dirname(fifo_parent_dir);
+ status = stat(fifo_parent_dir, &buffer);
+ if (status != 0) {
+ mkdir(fifo_parent_dir, 0644);
+ }
+ free(fifo_parent_dir);
status = stat(FIFO_DIR, &buffer);
if (status == 0) {
int file_mode = ((buffer.st_mode & S_IRWXU) >> 6) * 100;
diff --git a/kdm/kfrontend/sakdlg.cc b/kdm/kfrontend/sakdlg.cc
index 2ad6495b4..95f45bd10 100644
--- a/kdm/kfrontend/sakdlg.cc
+++ b/kdm/kfrontend/sakdlg.cc
@@ -66,6 +66,7 @@
#include <sys/time.h>
#include <termios.h>
#include <signal.h>
+#include <libgen.h>
#include "kfdialog.h"
@@ -164,6 +165,13 @@ void SAKDlg::handleInputPipe(void) {
umask(0);
struct stat buffer;
int status;
+ char *fifo_parent_dir = strdup(FIFO_DIR);
+ dirname(fifo_parent_dir);
+ status = stat(fifo_parent_dir, &buffer);
+ if (status != 0) {
+ mkdir(fifo_parent_dir, 0644);
+ }
+ free(fifo_parent_dir);
status = stat(FIFO_DIR, &buffer);
if (status == 0) {
int file_mode = ((buffer.st_mode & S_IRWXU) >> 6) * 100;
@@ -187,6 +195,9 @@ void SAKDlg::handleInputPipe(void) {
readbuf[numread] = 0;
readbuf[2047] = 0;
inputcommand += readbuf;
+ if (!tqApp->hasPendingEvents()) {
+ usleep(500);
+ }
tqApp->processEvents();
}
if (closingDown) {