util/iptables: fix cross-build failures due to syscall.Flock()

Fixes: https://github.com/kubernetes/kubernetes/issues/45554
This commit is contained in:
Dan Williams
2017-05-10 11:10:56 -05:00
parent 48caf95a6c
commit a4624a0e75
5 changed files with 136 additions and 74 deletions

View File

@@ -20,7 +20,6 @@ import (
"net"
"os"
"strings"
"syscall"
"testing"
"time"
@@ -1190,7 +1189,7 @@ func TestRestoreAllGrabNewLock(t *testing.T) {
}
defer runLock.Close()
if err := syscall.Flock(int(runLock.Fd()), syscall.LOCK_EX|syscall.LOCK_NB); err != nil {
if err := grabIptablesFileLock(runLock); err != nil {
t.Errorf("expected to lock %s, got %v", TestLockfilePath, err)
}