anchor.diff:  		       true -> MaxAcc
   		   end
   	   end,
  -    ?line case lists:foldl(Fun2, 0, Data1) of
  +    case lists:foldl(Fun2, 0, Data1) of
   	      Max when Max<100 ->
   		  Threshold3 = Max+1,
  -		  ?line ok =
  -		      disksup:set_almost_full_threshold(Threshold3/100),
  -		  ?line disksup ! timeout, % force a disk check
  -		  ?line Data3 = disksup:get_disk_data(),
  -		  ?line Over3 = over_threshold(Data3, Threshold3),
  -		  ?line Alarms3 = get_alarms(),
  +		  ok = disksup:set_almost_full_threshold(Threshold3/100),
  +		  disksup ! timeout, % force a disk check
  +		  Data3   = disksup:get_disk_data(),
  +		  Over3   = over_threshold(Data3, Threshold3),
  +		  Alarms3 = get_alarms(),
   		  if
   		      Over3==0, length(Alarms3)==0 ->
  -			  ?line ok;
  +			  ok;
   		      true ->
   			  dump_info(),
  -			  ?line ?t:fail({bad_alarms, Threshold3, Data3, Alarms3})
  +			  ?t:fail({bad_alarms, Threshold3, Data3, Alarms3})
   		  end;
   	      100 ->
  -		  ?line ignore
  +		  ignore
   	  end,
   
       %% Reset threshold
  -    ?line ok = disksup:set_almost_full_threshold(Threshold1/100),
  -
  +    ok = disksup:set_almost_full_threshold(Threshold1/100),
       ok.
   
   over_threshold(Data, Threshold) ->
       Data2 = remove_duplicated_disks(lists:keysort(1, Data)),
  -    lists:foldl(fun({_Id, _Kbyte, Cap}, N) when Cap>=Threshold ->
  -			N+1;
  -		   (_DiskData, N) ->
  -			N
  -		end,
  -		0,
  -		Data2).
  +    lists:foldl(fun
  +	    ({_Id, _Kbyte, Cap}, N) when Cap>=Threshold -> N+1;
  +	    (_DiskData, N) -> N
  +	end, 0, Data2).
   
   %% On some platforms (for example MontaVista) data for one disk can be
   %% "duplicated":
  
positive.code:     %% Wait a little to make sure disksup has been restarted,
      %% then make sure the alarms are set once, but not twice
      ?t:sleep(?t:seconds(1)),
      ?line Data3 = disksup:get_disk_data(),
      ?line Alarms2 = get_alarms(),
      if
  	length(Alarms2)==length(Alarms) ->
  	    ok;
  	true ->
  	    dump_info(),
  	    ?line ?t:fail({bad_alarms, Threshold, Data3, Alarms,Alarms2})
      end,
  
      %% Stop OS_Mon and make sure all disksup alarms are cleared
      ?line ok = application:stop(os_mon),
      ?t:sleep(?t:seconds(1)),
      ?line Alarms3 = get_alarms(),
      if
  	length(Alarms3)==0 ->
  	    ok;
  	true ->
  	    ?line ?t:fail({alarms_not_cleared, Alarms3})
      end,
  
      %% Reset threshold and restart OS_Mon
      ?line ok = application:set_env(os_mon,
  				   disksup_almost_full_threshold, 0.8),
      ?line ok = disksup:set_almost_full_threshold(0.8),
      ?line ok = application:start(os_mon),
  
      ok.
  
  dump_info() ->
  
negative.code: 	    {skip, {os_pid_not_found, Str}}
      end.
  
  terminate(suite) -> [];
  terminate(Config) when is_list(Config) ->
      ok = application:set_env(os_mon, start_disksup, false),
      ok = supervisor:terminate_child(os_mon_sup, disksup),
      ok.
  
  unavailable(suite) -> [];
  unavailable(doc) ->
      ["Test correct behaviour when service is unavailable"];
  unavailable(Config) when is_list(Config) ->
  
      %% Make sure all API functions return their dummy values
      [{"none",0,0}] = disksup:get_disk_data(),
      1800000 = disksup:get_check_interval(),
      ok = disksup:set_check_interval(5),
      80 = disksup:get_almost_full_threshold(),
      ok = disksup:set_almost_full_threshold(0.9),
      ok.
  
  restart(suite) ->
      [];
  restart(Config) when is_list(Config) ->
      ok = application:set_env(os_mon, start_disksup, true),
      {ok, _Pid} = supervisor:restart_child(os_mon_sup, disksup),
      ok.
  
  otp_5910(suite) -> [];
  otp_5910(doc) ->
      ["Test that alarms are cleared if disksup crashes or "
       "if OS_Mon is stopped"];
  otp_5910(Config) when is_list(Config) ->
  
      %% Make sure disksup sets at least one alarm
      Data = disksup:get_disk_data(),
      Threshold0 = disksup:get_almost_full_threshold(),
      Threshold  = case over_threshold(Data, Threshold0) of
  	0 ->
  	    [{_Id,_Kbyte,Cap}|_] = Data,
  	    ok = disksup:set_almost_full_threshold((Cap-1)/100),
  	    Cap-1;
  	_N -> Threshold0
      end,
      ok = application:set_env(os_mon, disk_almost_full_threshold, Threshold/100),
      disksup ! timeout, % force a disk check
      Data2 = disksup:get_disk_data(),
      Over = over_threshold(Data2, Threshold),
      Alarms = get_alarms(),
      if
  	Over==0 ->
  	    ?t:fail({threshold_too_low, Data2, Threshold});
  	Over==length(Alarms) ->
  	    ok;
  	true ->
  	    dump_info(),
  	    ?t:fail({bad_alarms, Threshold, Data2, Alarms})
      end,
  
      %% Kill disksup
  