Merge branch 'master' into kd-live

This commit is contained in:
2023-06-26 22:38:56 +09:00

View File

@ -9,6 +9,7 @@ import (
"os/exec" "os/exec"
"path" "path"
"strconv" "strconv"
"time"
) )
func copy(src, dst string) error { func copy(src, dst string) error {
@ -63,11 +64,20 @@ func main() {
if err != nil { if err != nil {
stdlog.Fatal(err) stdlog.Fatal(err)
} }
proc, err := os.FindProcess(pid)
if err != nil { for {
stdlog.Fatal(err) stdlog.Println("wait for terminating of", args[3])
proc, err := os.FindProcess(pid)
if err != nil {
stdlog.Fatal(err)
}
state, _ := proc.Wait()
if state == nil {
break
}
time.Sleep(time.Second)
} }
proc.Wait()
selfext, _ := os.Executable() selfext, _ := os.Executable()
selfext = path.Base(selfext) selfext = path.Base(selfext)