aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/crashdump_viewer.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2011-02-28 17:51:24 +0100
committerSiri Hansen <[email protected]>2011-02-28 17:51:24 +0100
commit910a25b6502150014ccbd71080d1363461406618 (patch)
treeca3d5094f4d31bdf7cdf310846e9c2475590088c /lib/observer/src/crashdump_viewer.erl
parent386a4db00c8c1664d98215f0c1350b890a336d30 (diff)
downloadotp-910a25b6502150014ccbd71080d1363461406618.tar.gz
otp-910a25b6502150014ccbd71080d1363461406618.tar.bz2
otp-910a25b6502150014ccbd71080d1363461406618.zip
Fix file descriptor leak in crashdump_viewer:chunk_page
Also, remove compiler warnings for crashdump_viewer_SUITE and fix Makefile in test directory so Emakefile does not grow.
Diffstat (limited to 'lib/observer/src/crashdump_viewer.erl')
-rw-r--r--lib/observer/src/crashdump_viewer.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/observer/src/crashdump_viewer.erl b/lib/observer/src/crashdump_viewer.erl
index 353a2db544..bf4910445b 100644
--- a/lib/observer/src/crashdump_viewer.erl
+++ b/lib/observer/src/crashdump_viewer.erl
@@ -2791,9 +2791,8 @@ chunk_page(SessionId,File,TW,What,HtmlCB,HtmlExtra,ParseFun) ->
lookup_and_parse_index_chunk(Cont,Fd,ParseFun))
end.
-chunk_page_1(Fd,HtmlInfo,SessionId,_ParseFun,done) ->
- crashdump_viewer_html:chunk(SessionId,done,HtmlInfo),
- close(Fd);
+chunk_page_1(_Fd,HtmlInfo,SessionId,_ParseFun,done) ->
+ crashdump_viewer_html:chunk(SessionId,done,HtmlInfo);
chunk_page_1(Fd,HtmlInfo,SessionId,ParseFun,{Chunk,Cont}) ->
crashdump_viewer_html:chunk(SessionId,Chunk,HtmlInfo),
chunk_page_1(Fd,HtmlInfo,SessionId,ParseFun,
@@ -2802,6 +2801,7 @@ chunk_page_1(Fd,HtmlInfo,SessionId,ParseFun,{Chunk,Cont}) ->
lookup_and_parse_index_chunk(Pointer,Fd,ParseFun) ->
case lookup_index_chunk(Pointer) of
'$end_of_table' ->
+ close(Fd),
done;
{Chunk,Cont} ->
R = lists:map(fun({Id,Start}) ->