remove any existing named pipe before creating a new one

This commit is contained in:
Bernhard B
2021-10-10 17:57:36 +02:00
parent d7825a4da8
commit 82fd577d48

View File

@@ -49,6 +49,9 @@ func main() {
tcpPort := tcpBasePort + ctr tcpPort := tcpBasePort + ctr
jsonRpc2ClientConfig.AddEntry(number, utils.ConfigEntry{TcpPort: tcpPort, FifoPathname: fifoPathname}) jsonRpc2ClientConfig.AddEntry(number, utils.ConfigEntry{TcpPort: tcpPort, FifoPathname: fifoPathname})
ctr += 1 ctr += 1
os.Remove(fifoPathname) //remove any existing named pipe
_, err = exec.Command("mkfifo", fifoPathname).Output() _, err = exec.Command("mkfifo", fifoPathname).Output()
if err != nil { if err != nil {
log.Fatal("Couldn't create fifo with name ", fifoPathname, ": ", err.Error()) log.Fatal("Couldn't create fifo with name ", fifoPathname, ": ", err.Error())