Skip to content

Commit 7faaaff

Browse files
committed
fix #199 Frequent kernel crashes if compiled with Go 1.14
1 parent f4844bf commit 7faaaff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kernel.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"runtime"
1414
"strings"
1515
"sync"
16+
"syscall"
1617
"time"
1718

1819
"github.com/cosmos72/gomacro/ast2"
@@ -573,8 +574,8 @@ func startHeartbeat(hbSocket Socket, wg *sync.WaitGroup) (shutdown chan struct{}
573574
default:
574575
// Check for received messages waiting at most 500ms for once to arrive.
575576
pingEvents, err := poller.Poll(500 * time.Millisecond)
576-
if err != nil {
577-
log.Fatalf("Error polling heartbeat channel: %v\n", err)
577+
if err != nil && zmq.AsErrno(err) != zmq.Errno(syscall.EINTR) {
578+
log.Fatalf("Error polling heartbeat channel: %T %#v %v\n", err, err, err)
578579
}
579580

580581
// If there is at least 1 message waiting then echo it.

0 commit comments

Comments
 (0)