1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2024-11-15 01:05:15 +01:00

ipc: remove unnecessary error check

os.MkdirAll never returns an os.IsExist error.

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
David Crawshaw 2020-05-02 16:18:17 +10:00 committed by Jason A. Donenfeld
parent 28c4d04304
commit c8596328e7
2 changed files with 2 additions and 4 deletions

View File

@ -151,8 +151,7 @@ func UAPIOpen(name string) (*os.File, error) {
// check if path exist // check if path exist
err := os.MkdirAll(socketDirectory, 0755) if err := os.MkdirAll(socketDirectory, 0755); err != nil {
if err != nil && !os.IsExist(err) {
return nil, err return nil, err
} }

View File

@ -148,8 +148,7 @@ func UAPIOpen(name string) (*os.File, error) {
// check if path exist // check if path exist
err := os.MkdirAll(socketDirectory, 0755) if err := os.MkdirAll(socketDirectory, 0755); err != nil {
if err != nil && !os.IsExist(err) {
return nil, err return nil, err
} }