Skip to content

Commit

Permalink
Fix pipe overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Borwe committed Nov 20, 2023
1 parent 50f4e61 commit c2edc0b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wakatime/wakatime.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func Execute(lang string, key string) {
_, w, error := os.Pipe()
r, w, error := os.Pipe()
if error != nil {
fmt.Fprintln(os.Stderr, "Error creating Pipe")
os.Exit(1)
Expand Down Expand Up @@ -46,6 +46,9 @@ func Execute(lang string, key string) {
//fmt.Printf("ERROR: %s",err) uncomment to see debug info
}

r.Close()
w.Close()

os.Remove(file.Name())

time.Sleep(time.Second * 3)
Expand Down

0 comments on commit c2edc0b

Please sign in to comment.