diff --git a/examples/activation/activation.go b/examples/activation/activation.go index 815a4539..04c76c1f 100644 --- a/examples/activation/activation.go +++ b/examples/activation/activation.go @@ -22,7 +22,7 @@ import ( "fmt" "os" - "github.com/coreos/go-systemd/v22/activation" + "github.com/huntresslabs/go-systemd/activation" ) func fixListenPid() { diff --git a/examples/activation/httpserver/httpserver.go b/examples/activation/httpserver/httpserver.go index ed848eed..002b700a 100644 --- a/examples/activation/httpserver/httpserver.go +++ b/examples/activation/httpserver/httpserver.go @@ -21,7 +21,7 @@ import ( "io" "net/http" - "github.com/coreos/go-systemd/v22/activation" + "github.com/huntresslabs/go-systemd/activation" ) func HelloServer(w http.ResponseWriter, req *http.Request) { diff --git a/examples/activation/listen.go b/examples/activation/listen.go index 1946196c..7d17e4bb 100644 --- a/examples/activation/listen.go +++ b/examples/activation/listen.go @@ -22,7 +22,7 @@ import ( "fmt" "os" - "github.com/coreos/go-systemd/v22/activation" + "github.com/huntresslabs/go-systemd/activation" ) func fixListenPid() { diff --git a/examples/activation/udpconn.go b/examples/activation/udpconn.go index 6b81615d..7d99f8f4 100644 --- a/examples/activation/udpconn.go +++ b/examples/activation/udpconn.go @@ -23,7 +23,7 @@ import ( "net" "os" - "github.com/coreos/go-systemd/v22/activation" + "github.com/huntresslabs/go-systemd/activation" ) func fixListenPid() { diff --git a/examples/journal/main.go b/examples/journal/main.go index 16508abf..52122a05 100644 --- a/examples/journal/main.go +++ b/examples/journal/main.go @@ -18,7 +18,7 @@ import ( "fmt" "os" - "github.com/coreos/go-systemd/v22/journal" + "github.com/huntresslabs/go-systemd/journal" ) func main() { diff --git a/go.mod b/go.mod index b8f26d46..401d781a 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/coreos/go-systemd/v22 +module github.com/huntresslabs/go-systemd go 1.23 diff --git a/journal/journal_unix_test.go b/journal/journal_unix_test.go index b9a600b9..bca4898b 100644 --- a/journal/journal_unix_test.go +++ b/journal/journal_unix_test.go @@ -23,7 +23,7 @@ import ( "syscall" "testing" - "github.com/coreos/go-systemd/v22/journal" + "github.com/huntresslabs/go-systemd/journal" ) func TestJournalStreamParsing(t *testing.T) { diff --git a/machine1/dbus.go b/machine1/dbus.go index 8b3f595a..c7135ac1 100644 --- a/machine1/dbus.go +++ b/machine1/dbus.go @@ -26,7 +26,7 @@ import ( "github.com/godbus/dbus/v5" - sd_dbus "github.com/coreos/go-systemd/v22/dbus" + sd_dbus "github.com/huntresslabs/go-systemd/dbus" ) const ( diff --git a/machine1/dbus_test.go b/machine1/dbus_test.go index 6641cc30..3cf2a12b 100644 --- a/machine1/dbus_test.go +++ b/machine1/dbus_test.go @@ -26,8 +26,8 @@ import ( "testing" "time" - sd_dbus "github.com/coreos/go-systemd/v22/dbus" "github.com/godbus/dbus/v5" + sd_dbus "github.com/huntresslabs/go-systemd/dbus" ) const ( diff --git a/sdjournal/functions.go b/sdjournal/functions.go deleted file mode 100644 index b5c2943c..00000000 --- a/sdjournal/functions.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2015 RedHat, Inc. -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package sdjournal - -import ( - "sync" - "unsafe" - - "github.com/coreos/go-systemd/v22/internal/dlopen" -) - -var ( - // lazy initialized - libsystemdHandle *dlopen.LibHandle - - libsystemdMutex = &sync.Mutex{} - libsystemdFunctions = map[string]unsafe.Pointer{} - libsystemdNames = []string{ - // systemd < 209 - "libsystemd-journal.so.0", - "libsystemd-journal.so", - - // systemd >= 209 merged libsystemd-journal into libsystemd proper - "libsystemd.so.0", - "libsystemd.so", - } -) - -func getFunction(name string) (unsafe.Pointer, error) { - libsystemdMutex.Lock() - defer libsystemdMutex.Unlock() - - if libsystemdHandle == nil { - h, err := dlopen.GetHandle(libsystemdNames) - if err != nil { - return nil, err - } - - libsystemdHandle = h - } - - f, ok := libsystemdFunctions[name] - if !ok { - var err error - f, err = libsystemdHandle.GetSymbolPointer(name) - if err != nil { - return nil, err - } - - libsystemdFunctions[name] = f - } - - return f, nil -} diff --git a/sdjournal/functions_test.go b/sdjournal/functions_test.go deleted file mode 100644 index 0f520bea..00000000 --- a/sdjournal/functions_test.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2015 RedHat, Inc. -// Copyright 2015 CoreOS, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package sdjournal - -import "testing" - -func TestGetFunction(t *testing.T) { - f, err := getFunction("sd_journal_open") - if err != nil { - t.Errorf("Error getting an existing function: %s", err) - } - - if f == nil { - t.Error("Got nil function pointer") - } - - _, err = getFunction("non_existent_function") - - if err == nil { - t.Error("Expected to get an error, got nil") - } -} diff --git a/sdjournal/journal_test.go b/sdjournal/journal_test.go index 963167b7..231d7780 100755 --- a/sdjournal/journal_test.go +++ b/sdjournal/journal_test.go @@ -26,7 +26,7 @@ import ( "testing" "time" - "github.com/coreos/go-systemd/v22/journal" + "github.com/huntresslabs/go-systemd/journal" ) func newJournal(t *testing.T) *Journal { diff --git a/util/util_cgo.go b/util/util_cgo.go index b8646647..9d53767c 100644 --- a/util/util_cgo.go +++ b/util/util_cgo.go @@ -59,7 +59,7 @@ import ( "syscall" "unsafe" - "github.com/coreos/go-systemd/v22/internal/dlopen" + "github.com/huntresslabs/go-systemd/internal/dlopen" ) var libsystemdNames = []string{