diff options
author | gary rong <garyrong0905@gmail.com> | 2018-07-12 16:07:51 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-07-12 16:07:51 +0800 |
commit | e8824f6e7409a2064b1165c5b6cc6b2d390573ce (patch) | |
tree | 6b8a57248492cb0253c21ee87b5932ecd6cc0ab0 /vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go | |
parent | a9835c1816bc49ee54c82b4f2a5b05cbcd89881b (diff) | |
download | go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar.gz go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar.bz2 go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar.lz go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar.xz go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.tar.zst go-tangerine-e8824f6e7409a2064b1165c5b6cc6b2d390573ce.zip |
vendor, ethdb: resume write operation asap (#17144)
* vendor: update leveldb
* ethdb: remove useless warning log
Diffstat (limited to 'vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go')
-rw-r--r-- | vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go index 7e2991537..d75f66a9e 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_unix.go @@ -67,13 +67,25 @@ func isErrInvalid(err error) bool { if err == os.ErrInvalid { return true } + // Go < 1.8 if syserr, ok := err.(*os.SyscallError); ok && syserr.Err == syscall.EINVAL { return true } + // Go >= 1.8 returns *os.PathError instead + if patherr, ok := err.(*os.PathError); ok && patherr.Err == syscall.EINVAL { + return true + } return false } func syncDir(name string) error { + // As per fsync manpage, Linux seems to expect fsync on directory, however + // some system don't support this, so we will ignore syscall.EINVAL. + // + // From fsync(2): + // Calling fsync() does not necessarily ensure that the entry in the + // directory containing the file has also reached disk. For that an + // explicit fsync() on a file descriptor for the directory is also needed. f, err := os.Open(name) if err != nil { return err |