Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/mix/lib/mix/sync/lock.ex
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ defmodule Mix.Sync.Lock do
end

defp base_path do
# We include user in the dir to avoid permission conflicts across users
user = System.get_env("USER", "default")
path = Path.join([System.tmp_dir!(), "mix_lock_#{Base.url_encode64(user, padding: false)}"])
File.mkdir_p!(path)
path
Path.join(System.tmp_dir!(), "mix_lock_#{Base.url_encode64(user, padding: false)}")
end

defp lock_disabled?(), do: System.get_env("MIX_OS_CONCURRENCY_LOCK") in ~w(0 false)
Expand Down
13 changes: 6 additions & 7 deletions lib/mix/lib/mix/sync/pubsub.ex
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,17 @@ defmodule Mix.Sync.PubSub do

defp hash(key), do: :erlang.md5(key)

defp base_path do
user = System.get_env("USER", "default")
path = Path.join([System.tmp_dir!(), "mix_pubsub_#{Base.url_encode64(user, padding: false)}"])
File.mkdir_p!(path)
path
end

defp path(hash) do
hash = Base.url_encode64(hash, padding: false)
Path.join(base_path(), hash)
end

defp base_path do
# We include user in the dir to avoid permission conflicts across users
user = System.get_env("USER", "default")
Path.join(System.tmp_dir!(), "mix_pubsub_#{Base.url_encode64(user, padding: false)}")
end

defp recv(socket, size, timeout \\ :infinity) do
# eintr is "Interrupted system call".
with {:error, :eintr} <- :gen_tcp.recv(socket, size, timeout) do
Expand Down
Loading