trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: February 2019

Bug 2998

From: Russell Brown <russell@...>
Date: Thu, 7 Feb 2019 15:52:21 +0000 (GMT)
Hi,

I don't know how closely the devs watch the Bug list but I believe I've
fixed Bug 2998.

As this bug results in kdesktop/kdesktop_lock eating CPU and going
unresponsive; might I humbly request that the fix is incorporated in the
next possible/dev version.

As the code I posted on bugzilla used a crude fixed buffer, here's a
cleaned up version that uses malloc.

*** /tmp/tdebase-trinity-14.0.6~pre38/kdesktop/lock/main.cc     Thu Feb  7 15:48:21 2019
--- /usr/tmp/tdebase-trinity-14.0.6~pre38/kdesktop/lock/main.cc Sun May 20 19:41:55 2018
***************
*** 325,336 ****
  #endif
          }
  
!         char *locknameroot="kdesktop_lock_lockfile.";
!         char *lockfilename = (char*)malloc(strlen(locknameroot) + strlen(getenv("DISPLAY")) + 1);
!         strcpy(lockfilename,locknameroot);
!         strcat(lockfilename,getenv("DISPLAY"));
! 
!         TDELockFile lock(locateLocal("tmp", lockfilename));
          lock.setStaleTime(0);
          TDELockFile::LockResult lockRet = lock.lock();
          if (lockRet != TDELockFile::LockOK) {
--- 325,331 ----
  #endif
          }
  
!         TDELockFile lock(locateLocal("tmp", "kdesktop_lock_lockfile"));
          lock.setStaleTime(0);
          TDELockFile::LockResult lockRet = lock.lock();
          if (lockRet != TDELockFile::LockOK) {


-- 
 Regards,
     Russell
 --------------------------------------------------------------------
| Russell Brown          | MAIL: russell@... PHONE: 01780 471800 |
| Lady Lodge Systems     | WWW Work: http://www.lls.com              |
| Peterborough, England  | WWW Play: http://www.ruffle.me.uk         |
 --------------------------------------------------------------------