diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-15 23:38:03 -0700 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-02-15 23:45:17 -0700 |
commit | d1952237edfbc3e2ab93a1109537c68144e9fd1e (patch) | |
tree | 76ad78453cbf13d069a9aa8c6490fd26da43aac1 /db.go | |
parent | Fix DB.opened flag. (diff) | |
download | dedo-d1952237edfbc3e2ab93a1109537c68144e9fd1e.tar.gz dedo-d1952237edfbc3e2ab93a1109537c68144e9fd1e.tar.xz |
Improve test coverage.
Diffstat (limited to 'db.go')
-rw-r--r-- | db.go | 17 |
1 files changed, 1 insertions, 16 deletions
@@ -240,7 +240,7 @@ func (db *DB) Close() { func (db *DB) close() { db.opened = false - + // TODO(benbjohnson): Undo everything in Open(). db.freelist = nil db.path = "" @@ -432,10 +432,6 @@ func (db *DB) Delete(name string, key []byte) error { // A reader transaction is maintained during the copy so it is safe to continue // using the database while a copy is in progress. func (db *DB) Copy(w io.Writer) error { - if !db.opened { - return DatabaseNotOpenError - } - // Maintain a reader transaction so pages don't get reclaimed. t, err := db.Transaction() if err != nil { @@ -514,14 +510,3 @@ func (db *DB) allocate(count int) (*page, error) { return p, nil } - -// sync flushes the file descriptor to disk. -func (db *DB) sync(force bool) error { - if db.opened { - return DatabaseNotOpenError - } - if err := syscall.Fsync(int(db.file.Fd())); err != nil { - return err - } - return nil -} |