mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 14:56:29 +00:00
support SIGINFO on Darwin
This commit is contained in:
parent
e7577d7bb4
commit
73cc11f000
@ -1,4 +1,4 @@
|
||||
// +build !windows
|
||||
// +build !windows,!darwin
|
||||
|
||||
package restic
|
||||
|
||||
|
23
src/restic/progress_unix_with_siginfo.go
Normal file
23
src/restic/progress_unix_with_siginfo.go
Normal file
@ -0,0 +1,23 @@
|
||||
// +build darwin
|
||||
|
||||
package restic
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
"restic/debug"
|
||||
)
|
||||
|
||||
func init() {
|
||||
c := make(chan os.Signal)
|
||||
signal.Notify(c, syscall.SIGUSR1)
|
||||
signal.Notify(c, syscall.SIGINFO)
|
||||
go func() {
|
||||
for s := range c {
|
||||
debug.Log("Signal received: %v\n", s)
|
||||
forceUpdateProgress <- true
|
||||
}
|
||||
}()
|
||||
}
|
Loading…
Reference in New Issue
Block a user