pkg/report: make isCorrupted linux-specific

isCorrupted is linux-specific, but is a global function.
Name can collide with other OSes. Make is linux method.
This commit is contained in:
Dmitry Vyukov 2017-11-14 09:47:44 +01:00
parent 10112655d7
commit 82b3b903a0

View File

@ -165,7 +165,7 @@ func (ctx *linux) Parse(output []byte) *Report {
rep.Desc = funcRe.ReplaceAllString(rep.Desc, "$1")
// CPU numbers are not interesting.
rep.Desc = cpuRe.ReplaceAllLiteralString(rep.Desc, "CPU")
rep.Corrupted = isCorrupted(rep.Desc, string(rep.Text))
rep.Corrupted = ctx.isCorrupted(rep.Desc, string(rep.Text))
return rep
}
@ -712,7 +712,7 @@ var linuxOopses = []*oops{
},
}
func isCorrupted(desc string, text string) bool {
func (ctx *linux) isCorrupted(desc string, text string) bool {
if !strings.Contains(text, "Call Trace") && !strings.Contains(text, "backtrace") {
// Text must contain 'Call Trace' or 'backtrace'.
return true