proc: bugfix: status does not work with programs containing spaces

/proc/pid/stat needs more complex parsing

Fixes #239
This commit is contained in:
aarzilli
2015-10-04 20:16:39 +02:00
committed by Derek Parker
parent db95b67b23
commit e509c3ce36
6 changed files with 82 additions and 18 deletions

View File

@ -272,7 +272,7 @@ func (dbp *Process) trapWait(pid int) (*Thread, error) {
switch port {
case dbp.os.notificationPort:
_, status, err := wait(dbp.Pid, dbp.Pid, 0)
_, status, err := dbp.wait(dbp.Pid, 0)
if err != nil {
return nil, err
}
@ -318,7 +318,10 @@ func (dbp *Process) trapWait(pid int) (*Thread, error) {
}
}
func wait(pid, tgid, options int) (int, *sys.WaitStatus, error) {
func (dbp *Process) loadProcessInformation(wg *sync.WaitGroup) {
}
func (dbp *Process) wait(pid, options int) (int, *sys.WaitStatus, error) {
var status sys.WaitStatus
wpid, err := sys.Wait4(pid, &status, options, nil)
return wpid, &status, err