-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differentiate signal handling for windows #382
Conversation
Windows has limited support for signals, and does not define syscall.SIGUSR1. Log rotation will be handled differently in windows. * Add signal.go for all non-windows builds * Add signal_windows.go for windows builds. Today, windows looks to be the only platform that does not have syscall.SIGUSR1 defined.
} | ||
c := make(chan os.Signal, 1) | ||
|
||
signal.Notify(c, syscall.SIGINT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could revert back to os.Interrupt here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change.
go func() { | ||
for sig := range c { | ||
Debugf("Trapped %q signal", sig) | ||
switch sig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one sig, so no need to switch etc,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change.
Windows has limited support for signals, and does not define
syscall.SIGUSR1
. Log rotation will be handled differently in windows.Today, windows looks to be the only platform that does not have
syscall.SIGUSR1
defined.Resolves #381