mirror of https://github.com/docker/cli.git
Merge pull request #4909 from vvoland/v25-4862
[25.0 backport] Avoid keeping @docker_cli_[UUID] files
This commit is contained in:
commit
98f603bdd1
|
@ -1,4 +1,4 @@
|
||||||
//go:build !darwin
|
//go:build !darwin && !openbsd
|
||||||
|
|
||||||
package socket
|
package socket
|
||||||
|
|
||||||
|
@ -15,5 +15,6 @@ func listen(socketname string) (*net.UnixListener, error) {
|
||||||
|
|
||||||
func onAccept(conn *net.UnixConn, listener *net.UnixListener) {
|
func onAccept(conn *net.UnixConn, listener *net.UnixListener) {
|
||||||
// do nothing
|
// do nothing
|
||||||
// while on darwin we would unlink here; on non-darwin the socket is abstract and not present on the filesystem
|
// while on darwin and OpenBSD we would unlink here;
|
||||||
|
// on non-darwin the socket is abstract and not present on the filesystem
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package socket
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
|
func listen(socketname string) (*net.UnixListener, error) {
|
||||||
|
return net.ListenUnix("unix", &net.UnixAddr{
|
||||||
|
Name: filepath.Join(os.TempDir(), socketname),
|
||||||
|
Net: "unix",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func onAccept(conn *net.UnixConn, listener *net.UnixListener) {
|
||||||
|
syscall.Unlink(listener.Addr().String())
|
||||||
|
}
|
Loading…
Reference in New Issue