Ignoring EINTR (ctrl+Z) signal
This commit is contained in:
parent
b155fc13d4
commit
0b9f044bb3
|
@ -6,6 +6,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/hpcloud/tail/util"
|
"github.com/hpcloud/tail/util"
|
||||||
|
|
||||||
|
@ -113,8 +114,12 @@ func (shared *InotifyTracker) run() {
|
||||||
case err, open := <-shared.watcher.Error:
|
case err, open := <-shared.watcher.Error:
|
||||||
if !open {
|
if !open {
|
||||||
return
|
return
|
||||||
|
} else if err != nil {
|
||||||
|
sysErr, ok := err.(*os.SyscallError)
|
||||||
|
if !ok || sysErr.Err != syscall.EINTR {
|
||||||
|
logger.Printf("Error in Watcher Error channel: %s", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
logger.Printf("Error in Watcher Errors channel: %s", err)
|
|
||||||
|
|
||||||
case <-shared.done:
|
case <-shared.done:
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue