mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-04-04 05:37:38 +03:00
Update deps
This commit is contained in:
parent
68f3ab249c
commit
d568e43937
39 changed files with 332 additions and 95 deletions
11
vendor/gopkg.in/natefinch/lumberjack.v2/.travis.yml
generated
vendored
11
vendor/gopkg.in/natefinch/lumberjack.v2/.travis.yml
generated
vendored
|
@ -1,6 +1,11 @@
|
|||
language: go
|
||||
|
||||
go:
|
||||
- 1.8
|
||||
- 1.7
|
||||
- 1.6
|
||||
- tip
|
||||
- 1.15.x
|
||||
- 1.14.x
|
||||
- 1.13.x
|
||||
- 1.12.x
|
||||
|
||||
env:
|
||||
- GO111MODULE=on
|
||||
|
|
6
vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go
generated
vendored
6
vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go
generated
vendored
|
@ -5,8 +5,8 @@ import (
|
|||
"syscall"
|
||||
)
|
||||
|
||||
// os_Chown is a var so we can mock it out during tests.
|
||||
var os_Chown = os.Chown
|
||||
// osChown is a var so we can mock it out during tests.
|
||||
var osChown = os.Chown
|
||||
|
||||
func chown(name string, info os.FileInfo) error {
|
||||
f, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, info.Mode())
|
||||
|
@ -15,5 +15,5 @@ func chown(name string, info os.FileInfo) error {
|
|||
}
|
||||
f.Close()
|
||||
stat := info.Sys().(*syscall.Stat_t)
|
||||
return os_Chown(name, int(stat.Uid), int(stat.Gid))
|
||||
return osChown(name, int(stat.Uid), int(stat.Gid))
|
||||
}
|
||||
|
|
16
vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go
generated
vendored
16
vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go
generated
vendored
|
@ -120,7 +120,7 @@ var (
|
|||
currentTime = time.Now
|
||||
|
||||
// os_Stat exists so it can be mocked out by tests.
|
||||
os_Stat = os.Stat
|
||||
osStat = os.Stat
|
||||
|
||||
// megabyte is the conversion factor between MaxSize and bytes. It is a
|
||||
// variable so tests can mock it out and not need to write megabytes of data
|
||||
|
@ -206,14 +206,14 @@ func (l *Logger) rotate() error {
|
|||
// openNew opens a new log file for writing, moving any old log file out of the
|
||||
// way. This methods assumes the file has already been closed.
|
||||
func (l *Logger) openNew() error {
|
||||
err := os.MkdirAll(l.dir(), 0744)
|
||||
err := os.MkdirAll(l.dir(), 0755)
|
||||
if err != nil {
|
||||
return fmt.Errorf("can't make directories for new logfile: %s", err)
|
||||
}
|
||||
|
||||
name := l.filename()
|
||||
mode := os.FileMode(0644)
|
||||
info, err := os_Stat(name)
|
||||
mode := os.FileMode(0600)
|
||||
info, err := osStat(name)
|
||||
if err == nil {
|
||||
// Copy the mode off the old logfile.
|
||||
mode = info.Mode()
|
||||
|
@ -265,7 +265,7 @@ func (l *Logger) openExistingOrNew(writeLen int) error {
|
|||
l.mill()
|
||||
|
||||
filename := l.filename()
|
||||
info, err := os_Stat(filename)
|
||||
info, err := osStat(filename)
|
||||
if os.IsNotExist(err) {
|
||||
return l.openNew()
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ func (l *Logger) openExistingOrNew(writeLen int) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// genFilename generates the name of the logfile from the current time.
|
||||
// filename generates the name of the logfile from the current time.
|
||||
func (l *Logger) filename() string {
|
||||
if l.Filename != "" {
|
||||
return l.Filename
|
||||
|
@ -376,7 +376,7 @@ func (l *Logger) millRunOnce() error {
|
|||
// millRun runs in a goroutine to manage post-rotation compression and removal
|
||||
// of old log files.
|
||||
func (l *Logger) millRun() {
|
||||
for _ = range l.millCh {
|
||||
for range l.millCh {
|
||||
// what am I going to do, log this?
|
||||
_ = l.millRunOnce()
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ func compressLogFile(src, dst string) (err error) {
|
|||
}
|
||||
defer f.Close()
|
||||
|
||||
fi, err := os_Stat(src)
|
||||
fi, err := osStat(src)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to stat log file: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue