From 28eff63eca17a8c7fa0ec5b6533286642a0587ea Mon Sep 17 00:00:00 2001 From: Matt Layher Date: Wed, 16 Jan 2019 16:50:56 -0500 Subject: [PATCH] pkg/runtime: use panic instead of log.Fatal for system call errors Signed-off-by: Matt Layher --- pkg/runtime/limits_default.go | 3 +-- pkg/runtime/uname_linux.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/runtime/limits_default.go b/pkg/runtime/limits_default.go index fb32d4b05..4f59b1c55 100644 --- a/pkg/runtime/limits_default.go +++ b/pkg/runtime/limits_default.go @@ -17,7 +17,6 @@ package runtime import ( "fmt" - "log" "syscall" ) @@ -37,7 +36,7 @@ func getLimits(resource int, unit string) string { rlimit := syscall.Rlimit{} err := syscall.Getrlimit(resource, &rlimit) 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)) } diff --git a/pkg/runtime/uname_linux.go b/pkg/runtime/uname_linux.go index aa6fa6ee0..96cf8e98b 100644 --- a/pkg/runtime/uname_linux.go +++ b/pkg/runtime/uname_linux.go @@ -14,7 +14,6 @@ package runtime import ( - "log" "syscall" ) @@ -23,7 +22,7 @@ func Uname() string { buf := syscall.Utsname{} err := syscall.Uname(&buf) if err != nil { - log.Fatal("Error!") + panic("syscall.Uname failed: " + err.Error()) } str := "(" + charsToString(buf.Sysname[:])