From 5de7b7c3f379987faa9cb06a58be8914f2d56cbe Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 26 Sep 2024 16:20:56 +0200 Subject: [PATCH] libpod: remove shutdown.Unregister() It is never used and needed so let's just remove some dead code. Signed-off-by: Paul Holzinger --- libpod/shutdown/handler.go | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/libpod/shutdown/handler.go b/libpod/shutdown/handler.go index ac41899e0e..e06e818c7c 100644 --- a/libpod/shutdown/handler.go +++ b/libpod/shutdown/handler.go @@ -140,29 +140,3 @@ func Register(name string, handler func(os.Signal) error) error { return nil } - -// Unregister un-registers a given shutdown handler. -func Unregister(name string) error { - handlerLock.Lock() - defer handlerLock.Unlock() - - if handlers == nil { - return nil - } - - if _, ok := handlers[name]; !ok { - return nil - } - - delete(handlers, name) - - newOrder := []string{} - for _, checkName := range handlerOrder { - if checkName != name { - newOrder = append(newOrder, checkName) - } - } - handlerOrder = newOrder - - return nil -}