~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/mnesia/src/mnesia_bup.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
    R;
110
110
safe_apply(R, What, Args) ->
111
111
    Abort = fun(Re) -> abort_restore(R, What, Args, Re) end,
112
 
    receive
113
 
        {'EXIT', Pid, Re} -> Abort({'EXIT', Pid, Re})
114
 
    after 0 ->
115
 
            Mod = R#restore.bup_module,
116
 
            case catch apply(Mod, What, Args) of
117
 
                {ok, Opaque, Items} when What =:= read ->
118
 
                    {R#restore{bup_data = Opaque}, Items};
119
 
                {ok, Opaque}  when What =/= read->
120
 
                    R#restore{bup_data = Opaque};
121
 
                {error, Re} ->
122
 
                    Abort(Re);
123
 
                Re ->
124
 
                    Abort(Re)
125
 
            end
 
112
    Mod = R#restore.bup_module,
 
113
    case catch apply(Mod, What, Args) of
 
114
        {ok, Opaque, Items} when What =:= read ->
 
115
            {R#restore{bup_data = Opaque}, Items};
 
116
        {ok, Opaque}  when What =/= read->
 
117
            R#restore{bup_data = Opaque};
 
118
        {error, Re} ->
 
119
            Abort(Re);
 
120
        Re ->
 
121
            Abort(Re)
126
122
    end.
127
123
 
128
124
abort_restore(R, What, Args, Reason) ->