Skip to content

Commit

Permalink
Merge pull request #471 from ElrondNetwork/fix-redirect-stderr-darwin
Browse files Browse the repository at this point in the history
Fix redirect stderr darwin
  • Loading branch information
LucianMincu authored Sep 23, 2019
2 parents 1bd5484 + 616be00 commit d9649a0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions core/logger/redirectStderrDarwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//+build darwin

package logger

import (
"os"
"syscall"
)

// redirectStderr redirects the output of the stderr to the file passed in
func redirectStderr(f *os.File) error {
err := syscall.Dup2(int(f.Fd()), int(os.Stderr.Fd()))
if err != nil {
return err
}

return nil
}
2 changes: 1 addition & 1 deletion core/logger/redirectStderrLinux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//+build linux darwin
//+build linux

package logger

Expand Down

0 comments on commit d9649a0

Please sign in to comment.