Skip to content

Commit

Permalink
merged two tiny files in unixsocket
Browse files Browse the repository at this point in the history
  • Loading branch information
burke committed May 24, 2013
1 parent 13d31fb commit 9ed6158
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
16 changes: 0 additions & 16 deletions go/unixsocket/sockname.go

This file was deleted.

17 changes: 13 additions & 4 deletions go/unixsocket/unixsocket.go
Expand Up @@ -18,10 +18,6 @@ import (
"syscall"
)

// http://code.google.com/p/rsc/source/browse/fuse/mount_linux.go
// https://github.com/hanwen/go-fuse/blob/master/fuse/mount.go
// http://code.google.com/p/go/source/browse/src/pkg/syscall/syscall_bsd.go?spec=svn982df2b2cb4b6001e8b60f9e8a000751e9a42198&name=982df2b2cb4b&r=982df2b2cb4b6001e8b60f9e8a000751e9a42198

func Socketpair(typ int) (a, b *os.File, err error) {
fd, err := syscall.Socketpair(syscall.AF_UNIX, typ, 0)
if err != nil {
Expand All @@ -33,3 +29,16 @@ func Socketpair(typ int) (a, b *os.File, err error) {
b = os.NewFile(uintptr(fd[1]), "socketpair-b")
return
}

var sockName string

func init() {
sockName = os.Getenv("ZEUSSOCK")
if sockName == "" {
sockName = ".zeus.sock"
}
}

func ZeusSockName() string {
return sockName
}

0 comments on commit 9ed6158

Please sign in to comment.