summaryrefslogtreecommitdiffstats
path: root/vendor/github.com
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-03-07 15:09:05 +0800
committerGitHub <noreply@github.com>2017-03-07 15:09:05 +0800
commitfa41ddd3ebcdd90a94bd1c56d095476604b1957c (patch)
tree8648f3c6cf3daf9c2d5713fbbd58406307f1323f /vendor/github.com
parent848293671b5d9c31ce3eb9ad8a1f130edd0ee7c5 (diff)
downloadgitea-fa41ddd3ebcdd90a94bd1c56d095476604b1957c.tar.gz
gitea-fa41ddd3ebcdd90a94bd1c56d095476604b1957c.zip
fix build failed on aarch64 (#1132)
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/ngaut/log/crash_darwin.go18
-rw-r--r--vendor/github.com/ngaut/log/crash_unix.go4
-rw-r--r--vendor/github.com/ngaut/log/log.go2
3 files changed, 21 insertions, 3 deletions
diff --git a/vendor/github.com/ngaut/log/crash_darwin.go b/vendor/github.com/ngaut/log/crash_darwin.go
new file mode 100644
index 0000000000..14ce5590c2
--- /dev/null
+++ b/vendor/github.com/ngaut/log/crash_darwin.go
@@ -0,0 +1,18 @@
+// +build darwin
+
+package log
+
+import (
+ "log"
+ "os"
+ "syscall"
+)
+
+func CrashLog(file string) {
+ f, err := os.OpenFile(file, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666)
+ if err != nil {
+ log.Println(err.Error())
+ } else {
+ syscall.Dup2(int(f.Fd()), 2)
+ }
+}
diff --git a/vendor/github.com/ngaut/log/crash_unix.go b/vendor/github.com/ngaut/log/crash_unix.go
index 37f407def9..5b9bc23aa2 100644
--- a/vendor/github.com/ngaut/log/crash_unix.go
+++ b/vendor/github.com/ngaut/log/crash_unix.go
@@ -1,4 +1,4 @@
-// +build freebsd openbsd netbsd dragonfly darwin linux
+// +build freebsd openbsd netbsd dragonfly linux
package log
@@ -13,6 +13,6 @@ func CrashLog(file string) {
if err != nil {
log.Println(err.Error())
} else {
- syscall.Dup2(int(f.Fd()), 2)
+ syscall.Dup3(int(f.Fd()), 2, 0)
}
}
diff --git a/vendor/github.com/ngaut/log/log.go b/vendor/github.com/ngaut/log/log.go
index 7e193715bd..896b393095 100644
--- a/vendor/github.com/ngaut/log/log.go
+++ b/vendor/github.com/ngaut/log/log.go
@@ -372,7 +372,7 @@ func genHourTime(t time.Time) string {
}
func New() *logger {
- return Newlogger(os.Stdout, "")
+ return Newlogger(os.Stderr, "")
}
func Newlogger(w io.Writer, prefix string) *logger {