Skip to content

Commit

Permalink
fix error handling
Browse files Browse the repository at this point in the history
printers were closing their stdout/stderr although they didn't create
those. this caused initBPF errors for example to get unseen
  • Loading branch information
itaysk committed Apr 4, 2021
1 parent 095336c commit f11eced
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion tracee-ebpf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func main() {
}
t, err := tracee.New(cfg)
if err != nil {
// t is being closed internally
return fmt.Errorf("error creating Tracee: %v", err)
}
return t.Run()
Expand Down
8 changes: 0 additions & 8 deletions tracee-ebpf/tracee/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ func (p tableEventPrinter) Epilogue(stats statsStore) {
}

func (p tableEventPrinter) Close() {
p.out.Close()
p.err.Close()
}

type templateEventPrinter struct {
Expand Down Expand Up @@ -210,8 +208,6 @@ func (p templateEventPrinter) Print(event external.Event) {
func (p templateEventPrinter) Epilogue(stats statsStore) {}

func (p templateEventPrinter) Close() {
p.out.Close()
p.err.Close()
}

type jsonEventPrinter struct {
Expand Down Expand Up @@ -242,8 +238,6 @@ func (p jsonEventPrinter) Error(e error) {
func (p jsonEventPrinter) Epilogue(stats statsStore) {}

func (p jsonEventPrinter) Close() {
p.out.Close()
p.err.Close()
}

// gobEventPrinter is printing events using golang's builtin Gob serializer
Expand Down Expand Up @@ -276,6 +270,4 @@ func (p *gobEventPrinter) Error(e error) {
func (p *gobEventPrinter) Epilogue(stats statsStore) {}

func (p gobEventPrinter) Close() {
p.out.Close()
p.err.Close()
}

0 comments on commit f11eced

Please sign in to comment.