diff options
author | Robert Griesemer <gri@golang.org> | 2009-11-09 21:23:52 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2009-11-09 21:23:52 -0800 |
commit | 9aad19327eb719775a874f8f18bb15958db1d471 (patch) | |
tree | c515081857e0b9ad897c6d35b0be64fe4c346688 /src/pkg/net/fd_linux.go | |
parent | 073e240233589933c43143c997247c33206bb066 (diff) | |
download | golang-9aad19327eb719775a874f8f18bb15958db1d471.tar.gz |
- replaced gofmt expression formatting algorithm with
rsc's algorithm
- applied gofmt -w misc src
- partial CL (last chunk)
R=rsc, r
http://go/go-review/1024041
Diffstat (limited to 'src/pkg/net/fd_linux.go')
-rw-r--r-- | src/pkg/net/fd_linux.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/net/fd_linux.go b/src/pkg/net/fd_linux.go index ddde33ee4..83d66ac89 100644 --- a/src/pkg/net/fd_linux.go +++ b/src/pkg/net/fd_linux.go @@ -73,7 +73,7 @@ func (p *pollster) StopWaiting(fd int, bits uint) { // If syscall.EPOLLONESHOT is not set, the wait // is a repeating wait, so don't change it. - if events & syscall.EPOLLONESHOT == 0 { + if events&syscall.EPOLLONESHOT == 0 { return } @@ -81,7 +81,7 @@ func (p *pollster) StopWaiting(fd int, bits uint) { // If we're still waiting for other events, modify the fd // event in the kernel. Otherwise, delete it. events &= ^uint32(bits); - if int32(events) & ^syscall.EPOLLONESHOT != 0 { + if int32(events)&^syscall.EPOLLONESHOT != 0 { var ev syscall.EpollEvent; ev.Fd = int32(fd); ev.Events = events; @@ -111,7 +111,7 @@ func (p *pollster) WaitFD(nsec int64) (fd int, mode int, err os.Error) { ev := &evarray[0]; var msec int = -1; if nsec > 0 { - msec = int((nsec+1e6-1)/1e6) + msec = int((nsec + 1e6 - 1) / 1e6) } n, e := syscall.EpollWait(p.epfd, &evarray, msec); for e == syscall.EAGAIN || e == syscall.EINTR { @@ -125,18 +125,18 @@ func (p *pollster) WaitFD(nsec int64) (fd int, mode int, err os.Error) { } fd = int(ev.Fd); - if ev.Events & writeFlags != 0 { + if ev.Events&writeFlags != 0 { p.StopWaiting(fd, writeFlags); return fd, 'w', nil; } - if ev.Events & readFlags != 0 { + if ev.Events&readFlags != 0 { p.StopWaiting(fd, readFlags); return fd, 'r', nil; } // Other events are error conditions - wake whoever is waiting. events, _ := p.events[fd]; - if events & writeFlags != 0 { + if events&writeFlags != 0 { p.StopWaiting(fd, writeFlags); return fd, 'w', nil; } |