1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge remote-tracking branch 'dominikh/minor-code-touchups'

This commit is contained in:
Solomon Hykes 2013-04-04 16:20:37 -07:00
commit 586a79cca0
5 changed files with 10 additions and 12 deletions

View file

@ -99,7 +99,7 @@ func (srv *Server) CmdLogin(stdin io.ReadCloser, stdout io.Writer, args ...strin
} }
if err != nil { if err != nil {
if err != io.EOF { if err != io.EOF {
fmt.Fprint(stdout, "Read error: %v\n", err) fmt.Fprintf(stdout, "Read error: %v\n", err)
} }
break break
} }
@ -512,10 +512,9 @@ func (srv *Server) CmdPush(stdin io.ReadCloser, stdout io.Writer, args ...string
return err return err
} }
return nil return nil
} else {
return err
} }
return nil
return err
} }
err = srv.runtime.graph.PushImage(stdout, img, srv.runtime.authConfig) err = srv.runtime.graph.PushImage(stdout, img, srv.runtime.authConfig)
if err != nil { if err != nil {

View file

@ -652,7 +652,7 @@ func (container *Container) WaitTimeout(timeout time.Duration) error {
case <-done: case <-done:
return nil return nil
} }
return nil panic("unreachable")
} }
func (container *Container) EnsureMounted() error { func (container *Container) EnsureMounted() error {

View file

@ -187,7 +187,7 @@ func (alloc *PortAllocator) Release(port int) error {
default: default:
return errors.New("Too many ports have been released") return errors.New("Too many ports have been released")
} }
return nil panic("unreachable")
} }
func newPortAllocator(start, end int) (*PortAllocator, error) { func newPortAllocator(start, end int) (*PortAllocator, error) {

View file

@ -22,10 +22,10 @@ func nuke(runtime *Runtime) error {
var wg sync.WaitGroup var wg sync.WaitGroup
for _, container := range runtime.List() { for _, container := range runtime.List() {
wg.Add(1) wg.Add(1)
go func() { go func(c *Container) {
container.Kill() c.Kill()
wg.Add(-1) wg.Done()
}() }(container)
} }
wg.Wait() wg.Wait()
return os.RemoveAll(runtime.root) return os.RemoveAll(runtime.root)
@ -91,7 +91,6 @@ func newTestRuntime() (*Runtime, error) {
return nil, err return nil, err
} }
if err := CopyDirectory(unitTestStoreBase, root); err != nil { if err := CopyDirectory(unitTestStoreBase, root); err != nil {
panic(err)
return nil, err return nil, err
} }

View file

@ -202,7 +202,7 @@ func (r *bufReader) Read(p []byte) (n int, err error) {
} }
r.wait.Wait() r.wait.Wait()
} }
return panic("unreachable")
} }
func (r *bufReader) Close() error { func (r *bufReader) Close() error {