summaryrefslogtreecommitdiffstats
path: root/kdm
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-17 21:20:34 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-17 21:20:34 -0600
commit1e2983ad0107fb1d26e3e9931528701f30632c6d (patch)
tree1e773c1d5d64ec7a200e4ed31c38c4ef05dd91bc /kdm
parent2e7d92a2af76d080c14f937cec79ccbfc0f48ea6 (diff)
downloadtdebase-1e2983ad0107fb1d26e3e9931528701f30632c6d.tar.gz
tdebase-1e2983ad0107fb1d26e3e9931528701f30632c6d.zip
Fix kdm_greet high CPU usage
Clean up a few build warnings
Diffstat (limited to 'kdm')
-rw-r--r--kdm/kfrontend/kgreeter.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/kdm/kfrontend/kgreeter.cpp b/kdm/kfrontend/kgreeter.cpp
index 9b974cc3a..5877cb6c7 100644
--- a/kdm/kfrontend/kgreeter.cpp
+++ b/kdm/kfrontend/kgreeter.cpp
@@ -273,6 +273,9 @@ void KGreeter::handleInputPipe(void) {
readbuf[numread] = 0;
readbuf[2047] = 0;
inputcommand += readbuf;
+ if (!tqApp->hasPendingEvents()) {
+ usleep(500);
+ }
tqApp->processEvents();
}
if (closingDown) {
@@ -508,11 +511,11 @@ KGreeter::insertUsers(int limit_users)
int count = 0;
for (setpwent(); (ps = getpwent()) != 0;) {
if (*ps->pw_dir && *ps->pw_shell &&
- (ps->pw_uid >= (unsigned)_lowUserId ||
- !ps->pw_uid && _showRoot) &&
- ps->pw_uid <= (unsigned)_highUserId &&
- !noUsers.hasUser( ps->pw_name ) &&
- !noUsers.hasGroup( ps->pw_gid ))
+ ((ps->pw_uid >= (unsigned)_lowUserId) ||
+ ((!ps->pw_uid) && _showRoot)) &&
+ (ps->pw_uid <= (unsigned)_highUserId) &&
+ (!noUsers.hasUser( ps->pw_name )) &&
+ (!noUsers.hasGroup( ps->pw_gid )))
{
TQString username( TQFile::decodeName( ps->pw_name ) );
if (!dupes.find( username )) {
@@ -574,7 +577,7 @@ KGreeter::insertUsers(int limit_users)
for (setpwent(); (ps = getpwent()) != 0;) {
if (*ps->pw_dir && *ps->pw_shell &&
(ps->pw_uid >= (unsigned)_lowUserId ||
- !ps->pw_uid && _showRoot) &&
+ ((!ps->pw_uid) && _showRoot)) &&
ps->pw_uid <= (unsigned)_highUserId &&
(users.hasUser( ps->pw_name ) ||
users.hasGroup( ps->pw_gid )))