Merge pull request #1060 from heptalium/master

Fix fillFromStatusWithContext() on systems with 128 bit signal masks.
pull/1067/head
shirou 4 years ago committed by GitHub
commit 008b5a41ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -935,30 +935,45 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error {
} }
p.memInfo.Locked = v * 1024 p.memInfo.Locked = v * 1024
case "SigPnd": case "SigPnd":
if len(value) > 16 {
value = value[len(value)-16:]
}
v, err := strconv.ParseUint(value, 16, 64) v, err := strconv.ParseUint(value, 16, 64)
if err != nil { if err != nil {
return err return err
} }
p.sigInfo.PendingThread = v p.sigInfo.PendingThread = v
case "ShdPnd": case "ShdPnd":
if len(value) > 16 {
value = value[len(value)-16:]
}
v, err := strconv.ParseUint(value, 16, 64) v, err := strconv.ParseUint(value, 16, 64)
if err != nil { if err != nil {
return err return err
} }
p.sigInfo.PendingProcess = v p.sigInfo.PendingProcess = v
case "SigBlk": case "SigBlk":
if len(value) > 16 {
value = value[len(value)-16:]
}
v, err := strconv.ParseUint(value, 16, 64) v, err := strconv.ParseUint(value, 16, 64)
if err != nil { if err != nil {
return err return err
} }
p.sigInfo.Blocked = v p.sigInfo.Blocked = v
case "SigIgn": case "SigIgn":
if len(value) > 16 {
value = value[len(value)-16:]
}
v, err := strconv.ParseUint(value, 16, 64) v, err := strconv.ParseUint(value, 16, 64)
if err != nil { if err != nil {
return err return err
} }
p.sigInfo.Ignored = v p.sigInfo.Ignored = v
case "SigCgt": case "SigCgt":
if len(value) > 16 {
value = value[len(value)-16:]
}
v, err := strconv.ParseUint(value, 16, 64) v, err := strconv.ParseUint(value, 16, 64)
if err != nil { if err != nil {
return err return err

@ -930,30 +930,45 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error {
} }
p.memInfo.Locked = v * 1024 p.memInfo.Locked = v * 1024
case "SigPnd": case "SigPnd":
if len(value) > 16 {
value = value[len(value)-16:]
}
v, err := strconv.ParseUint(value, 16, 64) v, err := strconv.ParseUint(value, 16, 64)
if err != nil { if err != nil {
return err return err
} }
p.sigInfo.PendingThread = v p.sigInfo.PendingThread = v
case "ShdPnd": case "ShdPnd":
if len(value) > 16 {
value = value[len(value)-16:]
}
v, err := strconv.ParseUint(value, 16, 64) v, err := strconv.ParseUint(value, 16, 64)
if err != nil { if err != nil {
return err return err
} }
p.sigInfo.PendingProcess = v p.sigInfo.PendingProcess = v
case "SigBlk": case "SigBlk":
if len(value) > 16 {
value = value[len(value)-16:]
}
v, err := strconv.ParseUint(value, 16, 64) v, err := strconv.ParseUint(value, 16, 64)
if err != nil { if err != nil {
return err return err
} }
p.sigInfo.Blocked = v p.sigInfo.Blocked = v
case "SigIgn": case "SigIgn":
if len(value) > 16 {
value = value[len(value)-16:]
}
v, err := strconv.ParseUint(value, 16, 64) v, err := strconv.ParseUint(value, 16, 64)
if err != nil { if err != nil {
return err return err
} }
p.sigInfo.Ignored = v p.sigInfo.Ignored = v
case "SigCgt": case "SigCgt":
if len(value) > 16 {
value = value[len(value)-16:]
}
v, err := strconv.ParseUint(value, 16, 64) v, err := strconv.ParseUint(value, 16, 64)
if err != nil { if err != nil {
return err return err

Loading…
Cancel
Save