mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 14:27:27 -08:00
pkg/runtime: use panic instead of log.Fatal for system call errors
Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
parent
45c8b084c6
commit
28eff63eca
|
@ -17,7 +17,6 @@ package runtime
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -37,7 +36,7 @@ func getLimits(resource int, unit string) string {
|
||||||
rlimit := syscall.Rlimit{}
|
rlimit := syscall.Rlimit{}
|
||||||
err := syscall.Getrlimit(resource, &rlimit)
|
err := syscall.Getrlimit(resource, &rlimit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error!")
|
panic("syscall.Getrlimit failed: " + err.Error())
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("(soft=%s, hard=%s)", limitToString(uint64(rlimit.Cur), unit), limitToString(uint64(rlimit.Max), unit))
|
return fmt.Sprintf("(soft=%s, hard=%s)", limitToString(uint64(rlimit.Cur), unit), limitToString(uint64(rlimit.Max), unit))
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -23,7 +22,7 @@ func Uname() string {
|
||||||
buf := syscall.Utsname{}
|
buf := syscall.Utsname{}
|
||||||
err := syscall.Uname(&buf)
|
err := syscall.Uname(&buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error!")
|
panic("syscall.Uname failed: " + err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
str := "(" + charsToString(buf.Sysname[:])
|
str := "(" + charsToString(buf.Sysname[:])
|
||||||
|
|
Loading…
Reference in a new issue