From 6f624c38f8d3f4c5558f930262476e295d2fd147 Mon Sep 17 00:00:00 2001 From: will Date: Mon, 5 Mar 2001 14:11:17 +0000 Subject: Fix build problem with kio_ldap where it was including instead of (for $DEITY knows why reason); fix kinfo_proc meddling in ProcessList.c. Reported by: MANY (ldap problem), mi, msmith (kinfo_proc) Submitted by: Sven Petai (partial patch for kinfo_proc, I added __FreeBSD_version #ifdefs and cleaned it up a bit) --- x11/kde4-baseapps/Makefile | 1 + x11/kde4-baseapps/files/patch-ProcessList.c | 108 ++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 x11/kde4-baseapps/files/patch-ProcessList.c (limited to 'x11/kde4-baseapps') diff --git a/x11/kde4-baseapps/Makefile b/x11/kde4-baseapps/Makefile index 4beb1235bc5f..d0b975e91dce 100644 --- a/x11/kde4-baseapps/Makefile +++ b/x11/kde4-baseapps/Makefile @@ -40,5 +40,6 @@ pre-configure: ${PERL} -pi -e "s@version-info 3:0@version-info ${SOMAJOR}:${SOMINOR}@g" ${WRKSRC}/libkonq/Makefile.in ${PERL} -pi -e "s@version-info 1:0:0@version-info ${SOMAJOR}:${SOMINOR}@g" ${WRKSRC}/khelpcenter/Makefile.in ${PERL} -pi -e "s@version-info 1:1:0@version-info ${SOMAJOR}:${SOMINOR}@g" ${WRKSRC}/nsplugins/Makefile.in + ${PERL} -pi -e "s@TIME_WITH_SYS_TIME@INVALID_FOO@g" ${WRKSRC}/kioslave/ldap/kldap.h .include diff --git a/x11/kde4-baseapps/files/patch-ProcessList.c b/x11/kde4-baseapps/files/patch-ProcessList.c new file mode 100644 index 000000000000..8574a62341eb --- /dev/null +++ b/x11/kde4-baseapps/files/patch-ProcessList.c @@ -0,0 +1,108 @@ +--- ksysguard/ksysguardd/FreeBSD/ProcessList.c Mon Jan 22 07:12:05 2001 ++++ ksysguard/ksysguardd/FreeBSD/ProcessList.c.new Mon Mar 5 08:56:20 2001 +@@ -29,6 +29,9 @@ + #include + #include + #include ++#if __FreeBSD_version > 500015 ++#include ++#endif + #include + #include + #include +@@ -162,7 +165,6 @@ + static char *statuses[] = { "idle","run","sleep","stop","zombie" }; + + ProcessInfo* ps; +- int userTime, sysTime; + struct passwd* pwent; + int mib[4]; + struct kinfo_proc p; +@@ -188,40 +190,56 @@ + if (sysctl(mib, 4, &p, &len, NULL, 0) == -1 || !len) + return -1; + ++#if __FreeBSD_version >= 500015 ++ ps->pid = p.ki_pid; ++ ps->ppid = p.ki_ppid; ++ ps->uid = p.ki_uid; ++ ps->gid = p.ki_pgid; ++ ps->priority = p.ki_pri.pri_user; ++ ps->niceLevel = p.ki_nice; ++#else + ps->pid = p.kp_proc.p_pid; + ps->ppid = p.kp_eproc.e_ppid; + ps->uid = p.kp_eproc.e_ucred.cr_uid; + ps->gid = p.kp_eproc.e_pgid; + ps->priority = p.kp_proc.p_priority; + ps->niceLevel = p.kp_proc.p_nice; ++#endif + + /* this isn't usertime -- it's total time (??) */ +-#if __FreeBSD_version >= 300000 ++#if __FreeBSD_version >= 500015 ++ ps->userTime = p.ki_runtime / 10000; ++#elif __FreeBSD_version >= 300000 + ps->userTime = p.kp_proc.p_runtime / 10000; + #else +- ps->userTime = p.kp_proc.p_rtime.tv_sec*100+p.kp_proc.p_rtime.tv_usec/100 ++ ps->userTime = p.kp_proc.p_rtime.tv_sec*100+p.kp_proc.p_rtime.tv_usec/100; + #endif + ps->sysTime = 0; +- ps->userLoad = p.kp_proc.p_pctcpu / 100; + ps->sysLoad = 0; + +- /* memory */ +- ps->vmSize = (p.kp_eproc.e_vm.vm_tsize + +- p.kp_eproc.e_vm.vm_dsize + +- p.kp_eproc.e_vm.vm_ssize) * getpagesize(); +- ps->vmRss = p.kp_eproc.e_vm.vm_rssize * getpagesize(); +- +- /* process name */ +- strncpy(ps->name,p.kp_proc.p_comm? p.kp_proc.p_comm:"????",sizeof(ps->name)); +- ps->name[sizeof(ps->name)-1]='\0'; +- +- /* find out user name with the process uid */ +- pwent = getpwuid(ps->uid); ++ /* memory, process name, process uid */ ++ /* find out user name with process uid */ ++ pwent = getpwuid(ps->uid); + strncpy(ps->userName,pwent&&pwent->pw_name? pwent->pw_name:"????",sizeof(ps->userName)); +- ps->userName[sizeof(ps->userName)-1]='\0'; +- +- /* status, a character, not a number */ +- strcpy(ps->status,(p.kp_proc.p_stat>=1)&&(p.kp_proc.p_stat<=5)? statuses[p.kp_proc.p_stat-1]:"????"); ++ ps->userName[sizeof(ps->userName)-1]='\0'; ++ ++#if __FreeBSD_version >= 500015 ++ ps->userLoad = p.ki_pctcpu / 100; ++ ps->vmSize = (p.ki_vmspace->vm_tsize + ++ p.ki_vmspace->vm_dsize + ++ p.ki_vmspace->vm_ssize) * getpagesize(); ++ ps->vmRss = p.ki_vmspace->vm_rssize * getpagesize(); ++ strncpy(ps->name,p.ki_comm? p.ki_comm:"????",sizeof(ps->name)); ++ strcpy(ps->status,(p.ki_stat>=1)&&(p.ki_stat<=5)? statuses[p.ki_stat-1]:"????"); ++#else ++ ps->userLoad = p.kp_proc.p_pctcpu / 100; ++ ps->vmSize = (p.kp_eproc.e_vm.vm_tsize + ++ p.kp_eproc.e_vm.vm_dsize + ++ p.kp_eproc.e_vm.vm_ssize) * getpagesize(); ++ ps->vmRss = p.kp_eproc.e_vm.vm_rssize * getpagesize(); ++ strncpy(ps->name,p.kp_proc.p_comm? p.kp_proc.p_comm:"????",sizeof(ps->name)); ++ strcpy(ps->status,(p.kp_proc.p_stat>=1)&&(p.kp_proc.p_stat<=5)? statuses[p.kp_proc.p_stat-1]:"????"); ++#endif + + /* process command line */ + /*strncpy(ps->cmdline,p.kp_proc.p_args->ar_args,sizeof(ps->cmdline)); +@@ -296,7 +314,11 @@ + sysctl(mib, 3, p, &len, NULL, 0); + + for (num = 0; num < len / sizeof(struct kinfo_proc); num++) ++#if __FreeBSD_version >= 500015 ++ updateProcess(p[num].ki_pid); ++#else + updateProcess(p[num].kp_proc.p_pid); ++#endif + + cleanupProcessList(); + -- cgit