Skip to content

Commit

Permalink
fix 'sanity check failed' error
Browse files Browse the repository at this point in the history
  • Loading branch information
yang yuan committed Sep 8, 2021
1 parent 94fc750 commit 22278eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion proc_master.go
Expand Up @@ -15,6 +15,7 @@ import (
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
"syscall"
"time"
Expand Down Expand Up @@ -282,13 +283,17 @@ func (mp *master) fetch() {
}
}
}()

tokenOut, err := cmd.CombinedOutput()
returned = true
if err != nil {
mp.warnf("failed to run temp binary: %s (%s) output \"%s\"", err, tmpBinPath, tokenOut)
return
}
if tokenIn != string(tokenOut) {
tokenOutStr := string(tokenOut)
tokenOutStrs := strings.Split(tokenOutStr, "\n")
tokenOutNew := tokenOutStrs[len(tokenOutStrs)-1]
if tokenIn != tokenOutNew {
mp.warnf("sanity check failed")
return
}
Expand Down

0 comments on commit 22278eb

Please sign in to comment.