ilovejs / leveldb-go

Automatically exported from code.google.com/p/leveldb-go
0 stars 0 forks source link

leveldb.Open does not work on Solaris #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I built 8c09ded0e4ad and attempting to create/open a persistent LevelDB using 
leveled.Open(dirname, nil) fails with an error message complaining that file 
locking is not implemented in solaris. The issue is the build constraints in 
leveldb/db/file_lock_unix.go and leveldb/db/file_lock_generic.go do not include 
Solaris/Illumos (which is supported as of Go 1.3).

The fix is:

diff -r 8c09ded0e4ad leveldb/db/file_lock_generic.go
--- a/leveldb/db/file_lock_generic.go   Thu Sep 25 10:17:15 2014 +1000
+++ b/leveldb/db/file_lock_generic.go   Fri Oct 10 20:02:50 2014 -0700
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.

-// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!windows
+// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!windows,!solaris

 package db

diff -r 8c09ded0e4ad leveldb/db/file_lock_unix.go
--- a/leveldb/db/file_lock_unix.go      Thu Sep 25 10:17:15 2014 +1000
+++ b/leveldb/db/file_lock_unix.go      Fri Oct 10 20:02:50 2014 -0700
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.

-// +build darwin dragonfly freebsd linux netbsd openbsd
+// +build darwin dragonfly freebsd linux netbsd openbsd solaris

 package db

Original issue reported on code.google.com by ma...@apsalar.com on 11 Oct 2014 at 3:03

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 445842cbd547.

Original comment by nigel...@golang.org on 22 Oct 2014 at 12:54