mirror of
https://github.com/siderolabs/talos.git
synced 2025-12-16 23:11:16 +01:00
refactor: use os.Remove instead of unix.Unlink (#648)
Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
This commit is contained in:
parent
3dc5606053
commit
a25cb09bf2
@ -12,7 +12,6 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"golang.org/x/sys/unix"
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -109,7 +108,7 @@ func NewListener(setters ...Option) (net.Listener, error) {
|
|||||||
// Unlink the address or we will get the error:
|
// Unlink the address or we will get the error:
|
||||||
// bind: address already in use.
|
// bind: address already in use.
|
||||||
if _, err := os.Stat(address); err == nil {
|
if _, err := os.Stat(address); err == nil {
|
||||||
if err := unix.Unlink(address); err != nil {
|
if err := os.Remove(address); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user