fix bad import path for cmd/podman/utils

Libpod or packages under /pkg should never import from /cmd/...
This will quickly result in import cycles and weird code paths.
Also there is no reason to use this special code we can just use
syscall.SIGHUB as SIGNAL.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2022-05-30 15:25:57 +02:00
parent a550af260a
commit a6f8cad545
3 changed files with 2 additions and 32 deletions

View File

@ -1,15 +0,0 @@
//go:build !windows
// +build !windows
package utils
import (
"os"
"golang.org/x/sys/unix"
)
// Platform specific signal synonyms
var (
SIGHUP os.Signal = unix.SIGHUP
)

View File

@ -1,15 +0,0 @@
//go:build windows
// +build windows
package utils
import (
"os"
"golang.org/x/sys/windows"
)
// Platform specific signal synonyms
var (
SIGHUP os.Signal = windows.SIGHUP
)

View File

@ -9,9 +9,9 @@ import (
"os" "os"
"os/signal" "os/signal"
"sync" "sync"
"syscall"
"github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/cgroups"
"github.com/containers/podman/v4/cmd/podman/utils"
"github.com/containers/podman/v4/libpod" "github.com/containers/podman/v4/libpod"
"github.com/containers/podman/v4/pkg/domain/entities" "github.com/containers/podman/v4/pkg/domain/entities"
"github.com/containers/podman/v4/pkg/namespaces" "github.com/containers/podman/v4/pkg/namespaces"
@ -375,7 +375,7 @@ func ParseIDMapping(mode namespaces.UsernsMode, uidMapSlice, gidMapSlice []strin
func StartWatcher(rt *libpod.Runtime) { func StartWatcher(rt *libpod.Runtime) {
// Setup the signal notifier // Setup the signal notifier
ch := make(chan os.Signal, 1) ch := make(chan os.Signal, 1)
signal.Notify(ch, utils.SIGHUP) signal.Notify(ch, syscall.SIGHUP)
go func() { go func() {
for { for {