diff options
author | Erland Schönbeck <[email protected]> | 2015-03-05 13:37:16 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2015-03-20 15:28:54 +0100 |
commit | 1132117b38cfe33e770a0d5b1a782d48667427c4 (patch) | |
tree | c40c3da27e2f10a3c50cd5a2b4dc8d9db03aa08b /lib/inets/src/tftp/tftp_sup.erl | |
parent | 403fe576cd71bf32c7e42b782bf3181d809bbc88 (diff) | |
download | otp-1132117b38cfe33e770a0d5b1a782d48667427c4.tar.gz otp-1132117b38cfe33e770a0d5b1a782d48667427c4.tar.bz2 otp-1132117b38cfe33e770a0d5b1a782d48667427c4.zip |
Use new time API and be back-compatible in inets
Remove unused functions and removed redundant test
Diffstat (limited to 'lib/inets/src/tftp/tftp_sup.erl')
-rw-r--r-- | lib/inets/src/tftp/tftp_sup.erl | 14 |
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() -> |