dnsmasq: gracefully handle temporarily not existing ready files

This commit is contained in:
Michael Stapelberg 2018-07-14 16:42:09 +02:00
parent 3afe757a34
commit bfa16c559f

View File

@ -125,7 +125,7 @@ func Run(t *testing.T, iface, ns string) *Process {
// listening for requests. // listening for requests.
for { for {
b, err := ioutil.ReadFile(ready.Name()) b, err := ioutil.ReadFile(ready.Name())
if err != nil { if err != nil && !os.IsNotExist(err) {
t.Fatal(err) t.Fatal(err)
} }
if strings.TrimSpace(string(b)) == strconv.Itoa(p.dnsmasq.Process.Pid) { if strings.TrimSpace(string(b)) == strconv.Itoa(p.dnsmasq.Process.Pid) {