perkeep/pkg/osutil/restart_unix.go

18 lines
354 B
Go
Raw Normal View History

// +build linux darwin
// TODO(mpl): Copyright in next CL.
package osutil
import (
"os"
"syscall"
)
// restartProcess returns an error if things couldn't be
// restarted. On success, this function never returns
// because the process becomes the new process.
func RestartProcess() error {
return syscall.Exec(os.Args[0], os.Args, os.Environ())
}