File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -95,13 +95,13 @@ type event struct {
9595// syscall.EpollCreate: http://man7.org/linux/man-pages/man2/epoll_create.2.html
9696// syscall.EpollCtl: http://man7.org/linux/man-pages/man2/epoll_ctl.2.html
9797func (e * event ) makeEvent (fd uintptr ) error {
98- epollFd , err := syscall .EpollCreate ( 1 )
98+ epollFd , err := syscall .EpollCreate1 ( syscall . EPOLL_CLOEXEC )
9999 switch {
100100 case err == nil :
101101 break
102102 case err .Error () == "function not implemented" :
103- // Some arch (arm64) do not implement EpollCreate() .
104- if epollFd , err = syscall .EpollCreate1 ( 0 ); err != nil {
103+ // Fall back to epoll_create .
104+ if epollFd , err = syscall .EpollCreate ( 1 ); err != nil {
105105 return err
106106 }
107107 default :
Original file line number Diff line number Diff line change @@ -132,13 +132,13 @@ func (e *eventsListener) init() error {
132132
133133func (e * eventsListener ) initLocked () error {
134134 var err error
135- e .epollFd , err = syscall .EpollCreate ( 1 )
135+ e .epollFd , err = syscall .EpollCreate1 ( syscall . EPOLL_CLOEXEC )
136136 switch {
137137 case err == nil :
138138 break
139139 case err .Error () == "function not implemented" :
140- // Some arch (arm64) do not implement EpollCreate() .
141- if e .epollFd , err = syscall .EpollCreate1 ( 0 ); err != nil {
140+ // Fall back to epoll_create .
141+ if e .epollFd , err = syscall .EpollCreate ( 1 ); err != nil {
142142 return err
143143 }
144144 default :
You can’t perform that action at this time.
0 commit comments