We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent8702e12 commitaf89c02Copy full SHA for af89c02
notify_socket.go
@@ -175,12 +175,18 @@ func notifyHost(client *net.UnixConn, ready []byte, pid1 int) error {
175
varerrUnexpectedRead=errors.New("unexpected read from synchronization pipe")
176
177
// sdNotifyBarrier performs synchronization with systemd by means of the sd_notify_barrier protocol.
178
-funcsdNotifyBarrier(client*net.UnixConn)error {
+funcsdNotifyBarrier(client*net.UnixConn)(retErrerror) {
179
// Create a pipe for communicating with systemd daemon.
180
pipeR,pipeW,err:=os.Pipe()
181
iferr!=nil {
182
returnerr
183
}
184
+deferfunc() {
185
+ifretErr!=nil {
186
+pipeW.Close()
187
+pipeR.Close()
188
+}
189
+}()
190
191
// Get the FD for the unix socket file to be able to use sendmsg.
192
clientFd,err:=client.File()