Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
🔨 Fix segmentation fault of syscall
Browse files Browse the repository at this point in the history
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
Original file line number Diff line number Diff line change
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.