]> Cypherpunks repositories - gostls13.git/commitdiff
os/exec: tell lsof not to block
authorKeith Randall <khr@golang.org>
Thu, 6 Nov 2014 04:25:20 +0000 (20:25 -0800)
committerKeith Randall <khr@golang.org>
Thu, 6 Nov 2014 04:25:20 +0000 (20:25 -0800)
For some reason lsof is now hanging on my workstation
without the -b (avoid blocking in the kernel) option.
Adding -b makes the test pass and shouldn't hurt.

I don't know how recent the -b option is.  If the builders
are ok with it, it's probably ok.

LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/166220043

src/os/exec/exec_test.go

index bc9c00effe554db124c15cde971dc93a02281bb4..197d3e8b40670f234825d50680f00478d7605f96 100644 (file)
@@ -246,7 +246,7 @@ func TestPipeLookPathLeak(t *testing.T) {
 }
 
 func numOpenFDS(t *testing.T) (n int, lsof []byte) {
-       lsof, err := exec.Command("lsof", "-n", "-p", strconv.Itoa(os.Getpid())).Output()
+       lsof, err := exec.Command("lsof", "-b", "-n", "-p", strconv.Itoa(os.Getpid())).Output()
        if err != nil {
                t.Skip("skipping test; error finding or running lsof")
        }