diff options
Diffstat (limited to 'lib/hipe')
-rw-r--r-- | lib/hipe/llvm/hipe_llvm_main.erl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/hipe/llvm/hipe_llvm_main.erl b/lib/hipe/llvm/hipe_llvm_main.erl index 54c435c127..1d7a51b5b1 100644 --- a/lib/hipe/llvm/hipe_llvm_main.erl +++ b/lib/hipe/llvm/hipe_llvm_main.erl @@ -527,7 +527,7 @@ unique_folder(FunName, Arity, Options) -> true -> %% Store folder in current directory DirName; false -> %% Temporarily store folder in tempfs (/dev/shm/) - "/dev/shm/" ++ DirName + tmpfs_folder() ++ DirName end, %% Make sure it does not exist case dir_exists(Dir) of @@ -537,6 +537,14 @@ unique_folder(FunName, Arity, Options) -> Dir end. +tmpfs_folder() -> + case os:type() of + {unix, linux} -> + "/dev/shm/"; + {unix, _} -> %% Fallback to tmp dir. e.g. FreeBSD + "/tmp/" + end. + %% @doc Function that checks that a given Filename is an existing Directory %% Name (from http://rosettacode.org/wiki/Ensure_that_a_file_exists#Erlang) dir_exists(Filename) -> |