diff options
Diffstat (limited to 'cmd/mbf')
| -rw-r--r-- | cmd/mbf/cache.go | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/cmd/mbf/cache.go b/cmd/mbf/cache.go index 166e1c45..156a6834 100644 --- a/cmd/mbf/cache.go +++ b/cmd/mbf/cache.go @@ -72,7 +72,7 @@ func (cache *cache) open() (err error) { } else if base, err = check.NewAbs(cache.base); err != nil { return } - var notify chan bool + var notify chan int if cache.idle { cache.attr.Flags |= pkg.CSchedIdle @@ -88,7 +88,7 @@ func (cache *cache) open() (err error) { } if cache.color { cache.attr.Flags |= pkg.CColourOutput - notify = make(chan bool, 1<<12) + notify = make(chan int, 1<<12) cache.attr.Notify = notify } @@ -141,22 +141,32 @@ func (cache *cache) open() (err error) { prefix := hostname + ": mbf " go func() { - var n, nc uint64 - for enter := range notify { - if enter { - nc++ - } else { + var n, nf, nc uint64 + for kind := range notify { + switch kind { + case pkg.NExit: nc-- n++ + break + + case pkg.NEnter: + nc++ + break + + case pkg.NFault: + nc-- + nf++ + break } - if nc == 0 { + if nf == 0 && nc == 0 { writeTitle(cache.msg, prefix[:len(prefix)-1]) continue } writeTitle(cache.msg, prefix+ "("+strconv.FormatUint(nc, 10)+ - " running, "+strconv.FormatUint(n, 10)+" complete)") + " running, "+strconv.FormatUint(n, 10)+" complete, "+ + strconv.FormatUint(nf, 10)+" fault)") } }() } |
