summaryrefslogtreecommitdiff
path: root/process/process.go
diff options
context:
space:
mode:
Diffstat (limited to 'process/process.go')
-rw-r--r--process/process.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/process/process.go b/process/process.go
index dade966..d33bf69 100644
--- a/process/process.go
+++ b/process/process.go
@@ -18,6 +18,7 @@ type Process struct {
Cmdline string
Count map[string]int
debug string
+ Last bool
}
func new(pidstr string) (Process, error) {
@@ -89,7 +90,7 @@ func (self *Process) Print() {
fmt.Println(self)
}
-func Gather(processes chan<- Process) {
+func Gather(pTxChan chan<- Process) {
re, _ := regexp.Compile("^[0-9]+$")
dir, err := ioutil.ReadDir("/proc/")
@@ -102,8 +103,9 @@ func Gather(processes chan<- Process) {
if re.MatchString(name) {
p, err := new(name)
if err == nil {
- processes <- p
+ pTxChan <- p
}
}
}
+ pTxChan <- Process{Last: true}
}