diff options
author | Henrik Nord <[email protected]> | 2011-09-29 17:32:47 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-09-29 17:32:50 +0200 |
commit | 0911888f960502e4ee789e82141090c31a2a83a8 (patch) | |
tree | 8fa7583c72397df898f3412849a72bbcfaca411a /lib/typer | |
parent | f9a8c0bd1de8693b8fbb9c2480bd45f6775f65b1 (diff) | |
parent | e4d5a206975e7718f6a95d5610ddc45b1d801c49 (diff) | |
download | otp-0911888f960502e4ee789e82141090c31a2a83a8.tar.gz otp-0911888f960502e4ee789e82141090c31a2a83a8.tar.bz2 otp-0911888f960502e4ee789e82141090c31a2a83a8.zip |
Merge branch 'sa/dialyzer-bug-fixes' into dev
* sa/dialyzer-bug-fixes:
Fix typer's crash for nonexisting files
Remove unused macro
Decrease tuple arity limit
Fix bug in dataflow
OTP-9597
Diffstat (limited to 'lib/typer')
-rw-r--r-- | lib/typer/src/typer.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/typer/src/typer.erl b/lib/typer/src/typer.erl index fd906c8c46..f2a70f49b7 100644 --- a/lib/typer/src/typer.erl +++ b/lib/typer/src/typer.erl @@ -466,14 +466,20 @@ write_typed_file(File, Info) -> case file:make_dir(TyperAnnDir) of {error, Reason} -> case Reason of - eexist -> %% TypEr dir exists; remove old typer files - ok = file:delete(NewFileName), + eexist -> %% TypEr dir exists; remove old typer files if they exist + case file:delete(NewFileName) of + ok -> ok; + {error, enoent} -> ok; + {error, _} -> + Msg = io_lib:format("Error in deleting file ~s\n", [NewFileName]), + fatal_error(Msg) + end, write_typed_file(File, Info, NewFileName); enospc -> Msg = io_lib:format("Not enough space in ~p\n", [Dir]), fatal_error(Msg); eacces -> - Msg = io:format("No write permission in ~p\n", [Dir]), + Msg = io_lib:format("No write permission in ~p\n", [Dir]), fatal_error(Msg); _ -> Msg = io_lib:format("Unhandled error ~s when writing ~p\n", |