aboutsummaryrefslogtreecommitdiff
path: root/db.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-02-15 23:38:03 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-02-15 23:45:17 -0700
commitd1952237edfbc3e2ab93a1109537c68144e9fd1e (patch)
tree76ad78453cbf13d069a9aa8c6490fd26da43aac1 /db.go
parentFix DB.opened flag. (diff)
downloaddedo-d1952237edfbc3e2ab93a1109537c68144e9fd1e.tar.gz
dedo-d1952237edfbc3e2ab93a1109537c68144e9fd1e.tar.xz
Improve test coverage.
Diffstat (limited to 'db.go')
-rw-r--r--db.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/db.go b/db.go
index 399e39b..99cc9ca 100644
--- a/db.go
+++ b/db.go
@@ -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
-}