github.com/mckael/restic@v0.8.3/internal/backend/sftp/foreground_windows.go (about)

     1  package sftp
     2  
     3  import (
     4  	"os/exec"
     5  
     6  	"github.com/restic/restic/internal/errors"
     7  )
     8  
     9  // startForeground runs cmd in the foreground, by temporarily switching to the
    10  // new process group created for cmd. The returned function `bg` switches back
    11  // to the previous process group.
    12  func startForeground(cmd *exec.Cmd) (bg func() error, err error) {
    13  	// just start the process and hope for the best
    14  	err = cmd.Start()
    15  	if err != nil {
    16  		return nil, errors.Wrap(err, "cmd.Start")
    17  	}
    18  
    19  	bg = func() error { return nil }
    20  	return bg, nil
    21  }