mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
pkg/dmesg: use unix.SYSLOG_ACTION_READ_ALL instead of local variable
This value was originally added in46833ee1c3, at which time golang.org/x/sys/unix didn't have utilities for this syscall. A later patch switched the implementation to use the golang/x/sys/unix implementation in2841b05b71, but kept the local variable. golang.org/x/sys now has a const for this, so let's use it. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -6,9 +6,8 @@ import (
|
||||
|
||||
// Dmesg returns last messages from the kernel log, up to size bytes
|
||||
func Dmesg(size int) []byte {
|
||||
t := 3 // SYSLOG_ACTION_READ_ALL
|
||||
b := make([]byte, size)
|
||||
amt, err := unix.Klogctl(t, b)
|
||||
amt, err := unix.Klogctl(unix.SYSLOG_ACTION_READ_ALL, b)
|
||||
if err != nil {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user