diff options
author | gahr <gahr@FreeBSD.org> | 2009-05-23 19:52:52 +0800 |
---|---|---|
committer | gahr <gahr@FreeBSD.org> | 2009-05-23 19:52:52 +0800 |
commit | 7b9aea4c4c48617f2c74f47d4cae6b46a15f4fe6 (patch) | |
tree | 1d2c25788a8dd966e8668c46b4ed66944743de3c /editors/codelite/files | |
parent | 3351ce0482ea436eaf747d9e73ee46d3542184cf (diff) | |
download | freebsd-ports-gnome-7b9aea4c4c48617f2c74f47d4cae6b46a15f4fe6.tar.gz freebsd-ports-gnome-7b9aea4c4c48617f2c74f47d4cae6b46a15f4fe6.tar.zst freebsd-ports-gnome-7b9aea4c4c48617f2c74f47d4cae6b46a15f4fe6.zip |
- Fix process handling routines. Do not issue external ps(1) commands, but
use kvm instead.
- Fix the codelite_kill_children shell script
Diffstat (limited to 'editors/codelite/files')
-rw-r--r-- | editors/codelite/files/patch-CodeLite_procutils.cpp | 101 | ||||
-rw-r--r-- | editors/codelite/files/patch-Runtime_codelite_kill_children | 10 | ||||
-rw-r--r-- | editors/codelite/files/patch-configure | 31 |
3 files changed, 123 insertions, 19 deletions
diff --git a/editors/codelite/files/patch-CodeLite_procutils.cpp b/editors/codelite/files/patch-CodeLite_procutils.cpp new file mode 100644 index 000000000000..f18f8fbdf2b2 --- /dev/null +++ b/editors/codelite/files/patch-CodeLite_procutils.cpp @@ -0,0 +1,101 @@ +--- CodeLite/procutils.cpp.orig 2009-01-09 17:34:59.000000000 +0100 ++++ CodeLite/procutils.cpp 2009-05-23 13:45:05.000000000 +0200 +@@ -40,6 +40,15 @@ + + #endif + ++#ifdef __FreeBSD__ ++#include <kvm.h> ++#include <fcntl.h> ++#include <sys/param.h> ++#include <sys/sysctl.h> ++#include <sys/user.h> ++#include <paths.h> ++#endif ++ + ProcUtils::ProcUtils() + { + } +@@ -135,6 +144,24 @@ + CloseHandle( hModuleSnap ); + return me32.szExePath; + ++#elif defined(__FreeBSD__) ++ kvm_t *kvd; ++ struct kinfo_proc *ki; ++ int nof_procs; ++ wxString cmd; ++ ++ if (!(kvd = kvm_openfiles(_PATH_DEVNULL, _PATH_DEVNULL, NULL, O_RDONLY, NULL))) ++ return wxEmptyString; ++ ++ if (!(ki = kvm_getprocs(kvd, KERN_PROC_PID, pid, &nof_procs))) { ++ kvm_close(kvd); ++ return wxEmptyString; ++ } ++ ++ cmd = wxString(ki->ki_ocomm, wxConvUTF8); ++ kvm_close(kvd); ++ ++ return (cmd); + #else + wxArrayString output; + ExecuteCommand(wxT("ps -A -o pid,command --no-heading"), output); +@@ -223,6 +250,28 @@ + proclist.push_back(entry); + } while (Process32Next (hProcessSnap, &pe)); + CloseHandle (hProcessSnap); ++ ++#elif defined(__FreeBSD__) ++ kvm_t *kvd; ++ struct kinfo_proc *ki; ++ int nof_procs, i; ++ ++ if (!(kvd = kvm_openfiles(_PATH_DEVNULL, _PATH_DEVNULL, NULL, O_RDONLY, NULL))) ++ return; ++ ++ if (!(ki = kvm_getprocs(kvd, KERN_PROC_PROC, 0, &nof_procs))) { ++ kvm_close(kvd); ++ return; ++ } ++ ++ for (i=0; i<nof_procs; i++) { ++ ProcessEntry entry; ++ entry.pid = ki[i].ki_pid; ++ entry.name = wxString(ki[i].ki_ocomm, wxConvUTF8); ++ proclist.push_back(entry); ++ } ++ kvm_close(kvd); ++ + #else + //GTK and other + wxArrayString output; +@@ -299,6 +348,28 @@ + } + } while (Process32Next (hProcessSnap, &pe)); + CloseHandle (hProcessSnap); ++ ++#elif defined(__FreeBSD__) ++ kvm_t *kvd; ++ struct kinfo_proc *ki; ++ int nof_procs, i; ++ ++ if (!(kvd = kvm_openfiles(_PATH_DEVNULL, _PATH_DEVNULL, NULL, O_RDONLY, NULL))) ++ return; ++ ++ if (!(ki = kvm_getprocs(kvd, KERN_PROC_PROC, pid, &nof_procs))) { ++ kvm_close(kvd); ++ return; ++ } ++ ++ for (i=0; i<nof_procs; i++) { ++ ProcessEntry entry; ++ if (ki[i].ki_ppid == pid) ++ proclist.push_back(ki[i].ki_pid); ++ } ++ ++ kvm_close(kvd); ++ + #else + //GTK and other + wxArrayString output; diff --git a/editors/codelite/files/patch-Runtime_codelite_kill_children b/editors/codelite/files/patch-Runtime_codelite_kill_children new file mode 100644 index 000000000000..377ac1368f33 --- /dev/null +++ b/editors/codelite/files/patch-Runtime_codelite_kill_children @@ -0,0 +1,10 @@ +--- Runtime/codelite_kill_children.orig 2009-05-23 13:23:08.000000000 +0200 ++++ Runtime/codelite_kill_children 2009-05-23 13:41:35.000000000 +0200 +@@ -1,6 +1,6 @@ + #!/bin/sh + +-procs=`ps --ppid $1 | grep -v PID | awk '{print $1;}'` ++procs=`ps -A -o ppid,pid | grep -v PPID | awk '{print $1" "$2}' | grep "^$1 " | awk '{print $2}' | xargs` + for p in $procs + do + kill -9 $p diff --git a/editors/codelite/files/patch-configure b/editors/codelite/files/patch-configure index 1b5838f7b602..9f25aa989935 100644 --- a/editors/codelite/files/patch-configure +++ b/editors/codelite/files/patch-configure @@ -1,19 +1,12 @@ ---- configure.orig 2008-05-14 19:24:35.000000000 +0200 -+++ configure 2008-05-15 21:48:27.000000000 +0200 -@@ -381,12 +383,10 @@ - - createEndMessage() - { -- if [ "$os_name" = "Linux" ]; then -- echo "post_build_msg:" >> Makefile -- echo " @echo ==========================================================" >> Makefile -- echo " @echo Done, please run \"sudo make install\"." >> Makefile -- echo " @echo ==========================================================" >> Makefile -- fi -+ echo "post_build_msg:" >> Makefile -+ echo " @echo ==========================================================" >> Makefile -+ echo " @echo Done, please run \"sudo make install\"." >> Makefile -+ echo " @echo ==========================================================" >> Makefile - } - - ## main +--- configure.orig 2009-03-12 13:14:45.000000000 +0100 ++++ configure 2009-05-23 00:58:21.000000000 +0200 +@@ -70,6 +70,9 @@ + else + echo "CCFLAGS := \$(CCFLAGS) -D__APPLE__ -DMACOSX" >> Makefile + fi ++ if [ "$os_name" = "FreeBSD" ]; then ++ echo "LINK_FLAGS := \$(LINK_FLAGS) -lkvm" >> Makefile ++ fi + echo "INCLUDES := \$(INCLUDES) -I. -I${base_dir}/sdk/wxsqlite3/include -I${base_dir}/sdk/wxsqlite3/sqlite3/include -I${base_dir}/sdk/wxscintilla/include -I${base_dir}/sdk/wxscintilla/src/scintilla/include -I${base_dir}/sdk/wxpropgrid/include -I${base_dir}/sdk/wxscintilla/src/scintilla/src -I${base_dir}/Interfaces -I${base_dir}/Debugger -I${base_dir}/Plugin -I${base_dir}/CodeLite " >> Makefile + echo "" >> Makefile + echo "" >> Makefile |