From e55403ed71282d7bfd8b56df219de3c28a8af064 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 25 Nov 2024 15:45:37 +0100 Subject: Merging upstream version 2.0.3+dfsg: - does not include dygraphs anymore (Closes: #923993) - does not include pako anymore (Closes: #1042533) - does not include dashboard binaries anymore (Closes: #1045145) Signed-off-by: Daniel Baumann --- src/go/logger/journal_linux.go | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'src/go/logger') diff --git a/src/go/logger/journal_linux.go b/src/go/logger/journal_linux.go index 00f335075..f55006bdb 100644 --- a/src/go/logger/journal_linux.go +++ b/src/go/logger/journal_linux.go @@ -5,29 +5,10 @@ package logger import ( - "os" - "strconv" - "strings" - "syscall" + "github.com/coreos/go-systemd/v22/journal" ) func isStderrConnectedToJournal() bool { - stream := os.Getenv("JOURNAL_STREAM") - if stream == "" { - return false - } - - idx := strings.IndexByte(stream, ':') - if idx <= 0 { - return false - } - - dev, ino := stream[:idx], stream[idx+1:] - - var stat syscall.Stat_t - if err := syscall.Fstat(int(os.Stderr.Fd()), &stat); err != nil { - return false - } - - return dev == strconv.Itoa(int(stat.Dev)) && ino == strconv.FormatUint(stat.Ino, 10) + ok, _ := journal.StderrIsJournalStream() + return ok } -- cgit v1.2.3