Skip to content

Commit

Permalink
Moved socket check at the bottom of the init function
Browse files Browse the repository at this point in the history
  • Loading branch information
Catalyn45 committed Mar 14, 2024
1 parent 2302f92 commit 5f82127
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions os_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ func init() {
filepath.Join(data, "lf", "icons"),
}

gFilesPath = filepath.Join(data, "lf", "files")
gMarksPath = filepath.Join(data, "lf", "marks")
gTagsPath = filepath.Join(data, "lf", "tags")
gHistoryPath = filepath.Join(data, "lf", "history")

socket, err := syscall.Socket(syscall.AF_UNIX, syscall.SOCK_STREAM, 0)
if err != nil {
gDefaultSocketProt = "tcp"
Expand All @@ -103,11 +108,6 @@ func init() {
gDefaultSocketPath = filepath.Join(data, "lf", fmt.Sprintf("lf.%s.sock", gUser.Username))
syscall.Close(socket)
}

gFilesPath = filepath.Join(data, "lf", "files")
gMarksPath = filepath.Join(data, "lf", "marks")
gTagsPath = filepath.Join(data, "lf", "tags")
gHistoryPath = filepath.Join(data, "lf", "history")
}

func detachedCommand(name string, arg ...string) *exec.Cmd {
Expand Down

0 comments on commit 5f82127

Please sign in to comment.