diff options
author | Erland Schönbeck <[email protected]> | 2015-03-24 13:52:07 +0100 |
---|---|---|
committer | Erland Schönbeck <[email protected]> | 2015-03-24 13:52:07 +0100 |
commit | e10385909c687590d6522d007bba9d72f3f5c380 (patch) | |
tree | 51227978bac92c6eb5f94c4bc20c2b9b7d1c396e /lib/inets/src/ftp | |
parent | 487446e76102b27fa8df02a353c7fdeec2d091f1 (diff) | |
download | otp-e10385909c687590d6522d007bba9d72f3f5c380.tar.gz otp-e10385909c687590d6522d007bba9d72f3f5c380.tar.bz2 otp-e10385909c687590d6522d007bba9d72f3f5c380.zip |
inets: Add new module inets_time_compat with new time API
The new module is backwards compatible.
Diffstat (limited to 'lib/inets/src/ftp')
-rw-r--r-- | lib/inets/src/ftp/ftp.erl | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/inets/src/ftp/ftp.erl b/lib/inets/src/ftp/ftp.erl index 361a775024..7eebe8d5bf 100644 --- a/lib/inets/src/ftp/ftp.erl +++ b/lib/inets/src/ftp/ftp.erl @@ -21,7 +21,6 @@ %% It also supports ipv6 RFC 2428 and starttls RFC 4217. -module(ftp). --compile([{nowarn_deprecated_function,{erlang,now,0}}]). -behaviour(gen_server). -behaviour(inets_service). @@ -2177,14 +2176,7 @@ handle_caller(#state{caller = {transfer_data, {Cmd, Bin, RemoteFile}}} = %% Connect to FTP server at Host (default is TCP port 21) %% in order to establish a control connection. setup_ctrl_connection(Host, Port, Timeout, State) -> - %% Adapt to OTP 18 erlang time API and be backwards compatible - MsTime = try - erlang:monotonic_time() - catch - error:undef -> - %% Use Erlang system time as monotonic time - erlang:now() - end, + MsTime = inets_time_compat:monotonic_time(), case connect(Host, Port, Timeout, State) of {ok, IpFam, CSock} -> NewState = State#state{csock = {tcp, CSock}, ipfamily = IpFam}, |