vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood
2019-06-27 13:52:32 +01:00
parent b221d79273
commit d61ba7ef78
281 changed files with 25276 additions and 12558 deletions
+2 -1
View File
@@ -2,13 +2,14 @@ language: go
go:
- 1.3
- 1.5
- tip
before_install:
- go get -t -v ./...
script:
- go test -coverprofile=coverage.txt -covermode=atomic
- go test -v -coverprofile=coverage.txt -covermode=atomic
after_success:
- bash <(curl -s https://codecov.io/bash)
+6 -10
View File
@@ -8,8 +8,6 @@ import (
"os"
"path/filepath"
"syscall"
"github.com/kardianos/osext"
)
// A Context describes daemon context.
@@ -172,7 +170,7 @@ func (d *Context) closeFiles() (err error) {
}
func (d *Context) prepareEnv() (err error) {
if d.abspath, err = osext.Executable(); err != nil {
if d.abspath, err = osExecutable(); err != nil {
return
}
@@ -218,7 +216,6 @@ func (d *Context) child() (err error) {
decoder := json.NewDecoder(os.Stdin)
if err = decoder.Decode(d); err != nil {
d.pidFile.Remove()
return
}
@@ -228,14 +225,14 @@ func (d *Context) child() (err error) {
if err = d.pidFile.WritePid(); err != nil {
return
}
defer func() {
if err != nil {
d.pidFile.Remove()
}
}()
}
if err = syscall.Close(0); err != nil {
d.pidFile.Remove()
return
}
if err = syscallDup(3, 0); err != nil {
d.pidFile.Remove()
return
}
@@ -245,7 +242,6 @@ func (d *Context) child() (err error) {
if len(d.Chroot) > 0 {
err = syscall.Chroot(d.Chroot)
if err != nil {
d.pidFile.Remove()
return
}
}
+40
View File
@@ -0,0 +1,40 @@
// +build solaris
package daemon
import (
"io"
"syscall"
)
func lockFile(fd uintptr) error {
lockInfo := syscall.Flock_t{
Type: syscall.F_WRLCK,
Whence: io.SeekStart,
Start: 0,
Len: 0,
}
if err := syscall.FcntlFlock(fd, syscall.F_SETLK, &lockInfo); err != nil {
if err == syscall.EAGAIN {
err = ErrWouldBlock
}
return err
}
return nil
}
func unlockFile(fd uintptr) error {
lockInfo := syscall.Flock_t{
Type: syscall.F_UNLCK,
Whence: io.SeekStart,
Start: 0,
Len: 0,
}
if err := syscall.FcntlFlock(fd, syscall.F_GETLK, &lockInfo); err != nil {
if err == syscall.EAGAIN {
err = ErrWouldBlock
}
return err
}
return nil
}
+1 -1
View File
@@ -1,4 +1,4 @@
// +build darwin dragonfly freebsd linux netbsd openbsd plan9 solaris
// +build darwin dragonfly freebsd linux netbsd openbsd plan9
package daemon
+11
View File
@@ -0,0 +1,11 @@
// +build go1.8
package daemon
import (
"os"
)
func osExecutable() (string, error) {
return os.Executable()
}
+11
View File
@@ -0,0 +1,11 @@
// +build !go1.8
package daemon
import (
"github.com/kardianos/osext"
)
func osExecutable() (string, error) {
return osext.Executable()
}
+3 -4
View File
@@ -1,12 +1,11 @@
// +build !linux !arm64
// +build !windows
// +build go1.7
package daemon
import (
"syscall"
)
import "golang.org/x/sys/unix"
func syscallDup(oldfd int, newfd int) (err error) {
return syscall.Dup2(oldfd, newfd)
return unix.Dup2(oldfd, newfd)
}
+13
View File
@@ -0,0 +1,13 @@
// +build !linux !arm64
// +build !windows
// +build !go1.7
package daemon
import (
"syscall"
)
func syscallDup(oldfd int, newfd int) (err error) {
return syscall.Dup2(oldfd, newfd)
}