mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Update chromedp to fix console errors (#1521)
This commit is contained in:
34
vendor/github.com/chromedp/sysutil/sysutil_linux.go
generated
vendored
Normal file
34
vendor/github.com/chromedp/sysutil/sysutil_linux.go
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// +build linux
|
||||
|
||||
package sysutil
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
btimePrefix = []byte("btime ")
|
||||
lineEnd = []byte("\n")
|
||||
)
|
||||
|
||||
func init() {
|
||||
buf, err := ioutil.ReadFile("/proc/stat")
|
||||
if err != nil {
|
||||
btime = time.Now()
|
||||
return
|
||||
}
|
||||
for _, line := range bytes.SplitN(buf, lineEnd, -1) {
|
||||
if bytes.HasPrefix(line, btimePrefix) {
|
||||
t, err := strconv.ParseInt(string(line[len(btimePrefix):]), 10, 64)
|
||||
if err != nil {
|
||||
btime = time.Now()
|
||||
return
|
||||
}
|
||||
btime = time.Unix(t, 0)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user