Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
masahide committed Sep 5, 2024
1 parent 99fe460 commit b0c69e8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions cmd/wsl2-ssh-agent-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,21 +312,18 @@ func main() {
ps := NewPwshIOStream(exePath)
defer ps.killPwsh()
go ps.sigStopWorker()
listener, err := net.Listen("unix", socketPath)
if err != nil {
log.Println("Error creating Unix domain socket:", err)
return
}
defer listener.Close()
for {
// Start PowerShell process
ctx, cancel := context.WithCancel(context.Background())
ps.setCancel(cancel)
go ps.startPowerShellProces(ctx)

// Handle kill signals

log.Printf("listen socket:%s", socketPath)
listener, err := net.Listen("unix", socketPath)
if err != nil {
log.Println("Error creating Unix domain socket:", err)
return
}
defer listener.Close()
ps.listenLoop(ctx, listener)
cancel()
}
Expand Down

0 comments on commit b0c69e8

Please sign in to comment.