aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/tftp/tftp_sup.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/inets/src/tftp/tftp_sup.erl')
-rw-r--r--lib/inets/src/tftp/tftp_sup.erl14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/inets/src/tftp/tftp_sup.erl b/lib/inets/src/tftp/tftp_sup.erl
index 1cafcc1069..54806bd432 100644
--- a/lib/inets/src/tftp/tftp_sup.erl
+++ b/lib/inets/src/tftp/tftp_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -93,7 +93,17 @@ unique_name(Options) ->
{value, {_, Port}} when is_integer(Port), Port > 0 ->
{tftpd, Port};
_ ->
- {tftpd, erlang:now()}
+ {tftpd, unique_integer()}
+ end.
+
+unique_integer() ->
+ %% Adapt to OTP 18 erlang time API and be back-compatible
+ try
+ erlang:unique_integer([positive])
+ catch
+ error:undef ->
+ {MS, S, US} = erlang:now(),
+ (MS*1000000+S)*1000000+US
end.
default_kill_after() ->