diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-07 11:46:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 11:46:48 -0500 |
commit | ef6748dc87126765cc97b6901d0f5adf297914d4 (patch) | |
tree | a9e268a307b853a9988da2515723b14e62d00ead /libpod/shutdown | |
parent | aac03d4a329580634c4c086352b1e0c4023937f4 (diff) | |
parent | bd2cfe0a9336b01122de851c528ad7f3e521af78 (diff) | |
download | podman-ef6748dc87126765cc97b6901d0f5adf297914d4.tar.gz podman-ef6748dc87126765cc97b6901d0f5adf297914d4.tar.bz2 podman-ef6748dc87126765cc97b6901d0f5adf297914d4.zip |
Merge pull request #8629 from mheon/no_error_on_dupe_handler
Do not error on installing duplicate shutdown handler
Diffstat (limited to 'libpod/shutdown')
-rw-r--r-- | libpod/shutdown/handler.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libpod/shutdown/handler.go b/libpod/shutdown/handler.go index 87538dec9..f0f228b19 100644 --- a/libpod/shutdown/handler.go +++ b/libpod/shutdown/handler.go @@ -11,6 +11,10 @@ import ( ) var ( + ErrHandlerExists error = errors.New("handler with given name already exists") +) + +var ( stopped bool sigChan chan os.Signal cancelChan chan bool @@ -98,7 +102,7 @@ func Register(name string, handler func(os.Signal) error) error { } if _, ok := handlers[name]; ok { - return errors.Errorf("handler with name %s already exists", name) + return ErrHandlerExists } handlers[name] = handler |