Skip to content

Commit

Permalink
fs: handle error msg with pread
Browse files Browse the repository at this point in the history
  • Loading branch information
nniclausse committed Aug 24, 2011
1 parent 38f89b6 commit 2be6155
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tsung/ts_fs.erl
Expand Up @@ -160,6 +160,10 @@ parse({file, pread, [_IODev,Pos,Size], {ok,_Data}},State=#state_rcv{dyndata=DynD
parse({file, pread, [_IODev,Pos,Size], eof},State=#state_rcv{dyndata=DynData,datasize=DataSize}) ->
NewDyn=(DynData#dyndata.proto)#fs_dyndata{position=0},
{State#state_rcv{ack_done=true,datasize=DataSize+Size,dyndata=DynData#dyndata{proto=NewDyn}}, [], false};
parse({file, pread, [_IODev,Pos,Size], {error,Reason}},State) ->
?LOGF("error while reading file: ~p~n",[Reason],?ERR),
ts_mon:add({count,error_fs_pread}),
{State#state_rcv{ack_done=true,datasize=0}, [], false};

parse({file, write_file, _Args, ok},State) ->
{State#state_rcv{ack_done=true,datasize=0}, [], false};
Expand Down

0 comments on commit 2be6155

Please sign in to comment.