aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2014-05-04 08:25:32 -0500
committerTristan Sloughter <[email protected]>2014-05-04 08:25:41 -0500
commitec5ce1d9d5b88d6d18fd4cd90764e1cf57261dea (patch)
tree8e79d4adaff77ae4a0e5d69c1c86f4ae7a316e36
parent95152fbb18cae3ba3cfe2a310b260f2fd06edad0 (diff)
downloadrelx-ec5ce1d9d5b88d6d18fd4cd90764e1cf57261dea.tar.gz
relx-ec5ce1d9d5b88d6d18fd4cd90764e1cf57261dea.tar.bz2
relx-ec5ce1d9d5b88d6d18fd4cd90764e1cf57261dea.zip
remove use of cwd to read symlink path
-rw-r--r--src/rlx_dscv_util.erl7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/rlx_dscv_util.erl b/src/rlx_dscv_util.erl
index a4a265c..aa642b8 100644
--- a/src/rlx_dscv_util.erl
+++ b/src/rlx_dscv_util.erl
@@ -110,11 +110,8 @@ discover_dir(ProcessDir, File, symlink) ->
discover_real_symlink_dir(ProcessDir, File)
end.
-discover_real_symlink_dir(ProcessDir, File) ->
- {ok, CurCwd} = file:get_cwd(),
- ok = file:set_cwd(File),
- {ok, ActualRealDir} = file:get_cwd(),
- ok = file:set_cwd(CurCwd),
+discover_real_symlink_dir(ProcessDir, File) ->
+ {ok, ActualRealDir} = file:read_link(File),
case lists:prefix(iolist_to_list(filename:absname(ActualRealDir)),
iolist_to_list(filename:absname(File))) of
true ->