Browse Source

only cares about error other than EOF

pull/2/head
Chris Lu 12 years ago
parent
commit
a4cef2fbd4
  1. 6
      go/storage/needle_map.go

6
go/storage/needle_map.go

@ -3,6 +3,7 @@ package storage
import ( import (
"code.google.com/p/weed-fs/go/util" "code.google.com/p/weed-fs/go/util"
"fmt" "fmt"
"io"
"os" "os"
) )
@ -60,7 +61,10 @@ func LoadNeedleMap(file *os.File) (*NeedleMap, error) {
count, e = nm.indexFile.Read(bytes) count, e = nm.indexFile.Read(bytes)
} }
return nm, nil
if e == io.EOF {
e = nil
}
return nm, e
} }
func (nm *NeedleMap) Put(key uint64, offset uint32, size uint32) (int, error) { func (nm *NeedleMap) Put(key uint64, offset uint32, size uint32) (int, error) {

Loading…
Cancel
Save