github.com/fawick/restic@v0.1.1-0.20171126184616-c02923fbfc79/internal/restic/progress_unix.go (about)

     1  // +build !windows,!darwin,!freebsd,!netbsd,!openbsd,!dragonfly
     2  
     3  package restic
     4  
     5  import (
     6  	"os"
     7  	"os/signal"
     8  	"syscall"
     9  
    10  	"github.com/restic/restic/internal/debug"
    11  )
    12  
    13  func init() {
    14  	c := make(chan os.Signal)
    15  	signal.Notify(c, syscall.SIGUSR1)
    16  	go func() {
    17  		for s := range c {
    18  			debug.Log("Signal received: %v\n", s)
    19  			forceUpdateProgress <- true
    20  		}
    21  	}()
    22  }