summaryrefslogtreecommitdiffstats
path: root/kdm
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-17 21:20:34 -0600
committerSlávek Banko <slavek.banko@axis.cz>2012-06-03 03:26:42 +0200
commitc78746a4256b4bdac9b90abbdffcc25999ad66d7 (patch)
treeb3e89c36d5be46442791f687e473d3d38c7e3d5a /kdm
parent51efe6d30e8ea5c65028e82aef19c543dd4f7a00 (diff)
downloadtdebase-c78746a4256b4bdac9b90abbdffcc25999ad66d7.tar.gz
tdebase-c78746a4256b4bdac9b90abbdffcc25999ad66d7.zip
Fix kdm_greet high CPU usage
Clean up a few build warnings (cherry picked from commit 1e2983ad0107fb1d26e3e9931528701f30632c6d)
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 )))