1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-02 00:23:42 +00:00

vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood
2019-06-27 12:30:45 +01:00
parent b221d79273
commit d61ba7ef78
281 changed files with 25277 additions and 12559 deletions

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)

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
}
}

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
}

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
vendor/github.com/sevlyar/go-daemon/os_executable.go generated vendored Normal file
View File

@@ -0,0 +1,11 @@
// +build go1.8
package daemon
import (
"os"
)
func osExecutable() (string, error) {
return os.Executable()
}

View File

@@ -0,0 +1,11 @@
// +build !go1.8
package daemon
import (
"github.com/kardianos/osext"
)
func osExecutable() (string, error) {
return osext.Executable()
}

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)
}

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)
}