|
|
@ -129,25 +129,17 @@ func getProvidedFDs() (savedErr error) { |
|
|
|
return savedErr |
|
|
|
return savedErr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// CloseProvidedListeners closes all unused provided listeners.
|
|
|
|
// closeProvidedListeners closes all unused provided listeners.
|
|
|
|
func CloseProvidedListeners() error { |
|
|
|
func closeProvidedListeners() { |
|
|
|
mutex.Lock() |
|
|
|
mutex.Lock() |
|
|
|
defer mutex.Unlock() |
|
|
|
defer mutex.Unlock() |
|
|
|
var returnableError error |
|
|
|
|
|
|
|
for _, l := range providedListeners { |
|
|
|
for _, l := range providedListeners { |
|
|
|
err := l.Close() |
|
|
|
err := l.Close() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Error("Error in closing unused provided listener: %v", err) |
|
|
|
log.Error("Error in closing unused provided listener: %v", err) |
|
|
|
if returnableError != nil { |
|
|
|
|
|
|
|
returnableError = fmt.Errorf("%v & %w", returnableError, err) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
returnableError = err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
providedListeners = []net.Listener{} |
|
|
|
providedListeners = []net.Listener{} |
|
|
|
|
|
|
|
|
|
|
|
return returnableError |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// DefaultGetListener obtains a listener for the stream-oriented local network address:
|
|
|
|
// DefaultGetListener obtains a listener for the stream-oriented local network address:
|
|
|
|