[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kcontrol/kfontinst/lib
From:       Brian Ledbetter <brian () shadowcom ! net>
Date:       2003-07-22 18:47:32
[Download RAW message or body]

CVS commit by brian: 

BUGFIX: This code wasn't building on FreeBSD 5.x.  Seemed to be due to the
usage of p.ki_comm instead of the correct p[num].ki_comm.  Also got errors
converting from (void*) to (struct kinfo_proc*) at the malloc() statement.
Added a typecast which _should_ work on any platform.  If it causes any problems
on Non-BSD platforms, my sincerest apologies.  :)


  M +3 -3      GetPid.c   1.2


--- kdebase/kcontrol/kfontinst/lib/GetPid.c  #1.1:1.2
@@ -158,5 +158,5 @@ static unsigned int getPid(const char *p
     mib[2] = KERN_PROC_ALL;
     sysctl(mib, 3, NULL, &len, NULL, 0);
-    p=malloc(len);
+    p=(struct kinfo_proc*)malloc(len);
     sysctl(mib, 3, p, &len, NULL, 0);
 
@@ -181,5 +181,5 @@ static unsigned int getPid(const char *p
         {
 #ifdef __FreeBSD_version
-            if(proc_p.ki_ppid==ppid && p.ki_comm && 0==strcmp(p.ki_comm, proc))
+            if(proc_p.ki_ppid==ppid && p[num].ki_comm && 0==strcmp(p[num].ki_comm, proc))
                 if(pid)
                     error=true;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic