aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEric Meadows-Jönsson <[email protected]>2017-10-25 21:11:28 +0200
committerEric Meadows-Jönsson <[email protected]>2017-10-25 21:11:28 +0200
commite46c14eab593f9c4cc4cf0efe6f3753964035b22 (patch)
tree242423f2433269a8c231016fe76ce7afe9e7b31d /lib
parent976bd95467a9dcae615a087c431024aabaebe8d6 (diff)
downloadotp-e46c14eab593f9c4cc4cf0efe6f3753964035b22.tar.gz
otp-e46c14eab593f9c4cc4cf0efe6f3753964035b22.tar.bz2
otp-e46c14eab593f9c4cc4cf0efe6f3753964035b22.zip
Return error when unable to make dir
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib/src/erl_tar.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/stdlib/src/erl_tar.erl b/lib/stdlib/src/erl_tar.erl
index 76f0b38108..48bbd38f9b 100644
--- a/lib/stdlib/src/erl_tar.erl
+++ b/lib/stdlib/src/erl_tar.erl
@@ -1650,8 +1650,12 @@ write_file(Name, Bin) ->
case file:write_file(Name, Bin) of
ok -> ok;
{error,enoent} ->
- ok = make_dirs(Name, file),
- write_file(Name, Bin);
+ case make_dirs(Name, file) of
+ ok ->
+ write_file(Name, Bin);
+ {error,Reason} ->
+ throw({error, Reason})
+ end;
{error,Reason} ->
throw({error, Reason})
end.