Skip to content
Permalink
Browse files Browse the repository at this point in the history
🔨 Fix segmentation fault of syscall
If teler is run via the docker image, the syscall function cannot allocate and return a nil pointer to address.
  • Loading branch information
dwisiswant0 committed Nov 2, 2020
1 parent 7be1cb4 commit ec60820
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/errors/abort.go
Expand Up @@ -2,10 +2,17 @@

package errors

import "syscall"
import (
"os"
"syscall"
)

// Abort will terminate & sends SIGTERM to process
func Abort(i ...int) {
if _, err := os.Stat("/.dockerenv"); err == nil {
os.Exit(i[0])
}

pgid, err := syscall.Getpgid(syscall.Getpid())
if err != nil {
Exit(err.Error())
Expand Down

0 comments on commit ec60820

Please sign in to comment.