mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-03 12:07:54 +00:00
Fix windows build by moving references to SIGUSR2 into a file not built (#6422)
on windows.
This commit is contained in:
@@ -629,20 +629,3 @@ func MakeSighupCh() chan struct{} {
|
|||||||
}()
|
}()
|
||||||
return resultCh
|
return resultCh
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeSigUSR2Ch returns a channel that can be used for SIGUSR2
|
|
||||||
// goroutine logging. This channel will send a message for every
|
|
||||||
// SIGUSR2 received.
|
|
||||||
func MakeSigUSR2Ch() chan struct{} {
|
|
||||||
resultCh := make(chan struct{})
|
|
||||||
|
|
||||||
signalCh := make(chan os.Signal, 4)
|
|
||||||
signal.Notify(signalCh, syscall.SIGUSR2)
|
|
||||||
go func() {
|
|
||||||
for {
|
|
||||||
<-signalCh
|
|
||||||
resultCh <- struct{}{}
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
return resultCh
|
|
||||||
}
|
|
||||||
|
|||||||
26
command/commands_nonwindows.go
Normal file
26
command/commands_nonwindows.go
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
// +build !windows
|
||||||
|
|
||||||
|
package command
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MakeSigUSR2Ch returns a channel that can be used for SIGUSR2
|
||||||
|
// goroutine logging. This channel will send a message for every
|
||||||
|
// SIGUSR2 received.
|
||||||
|
func MakeSigUSR2Ch() chan struct{} {
|
||||||
|
resultCh := make(chan struct{})
|
||||||
|
|
||||||
|
signalCh := make(chan os.Signal, 4)
|
||||||
|
signal.Notify(signalCh, syscall.SIGUSR2)
|
||||||
|
go func() {
|
||||||
|
for {
|
||||||
|
<-signalCh
|
||||||
|
resultCh <- struct{}{}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
return resultCh
|
||||||
|
}
|
||||||
8
command/commands_windows.go
Normal file
8
command/commands_windows.go
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// +build windows
|
||||||
|
|
||||||
|
package command
|
||||||
|
|
||||||
|
// MakeSigUSR2Ch does nothing useful on Windows.
|
||||||
|
func MakeSigUSR2Ch() chan struct{} {
|
||||||
|
return make(chan struct{})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user