diff options
author | John Högberg <[email protected]> | 2018-07-26 09:56:47 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-07-26 09:56:47 +0200 |
commit | d9d694ca3ea8a168c51145fc485a3bcbc18f6188 (patch) | |
tree | 3ae824615ddadabdbeae2679b1aa4f717195b4b8 /erts/preloaded | |
parent | d7e303cb7981e2ceb0eb0074cf7402feec5da868 (diff) | |
parent | a0b2cc0a377d780fe938ba9be3e417c7a8e00914 (diff) | |
download | otp-d9d694ca3ea8a168c51145fc485a3bcbc18f6188.tar.gz otp-d9d694ca3ea8a168c51145fc485a3bcbc18f6188.tar.bz2 otp-d9d694ca3ea8a168c51145fc485a3bcbc18f6188.zip |
Merge branch 'maint'
Diffstat (limited to 'erts/preloaded')
-rw-r--r-- | erts/preloaded/ebin/prim_file.beam | bin | 27740 -> 27800 bytes | |||
-rw-r--r-- | erts/preloaded/src/prim_file.erl | 21 |
2 files changed, 13 insertions, 8 deletions
diff --git a/erts/preloaded/ebin/prim_file.beam b/erts/preloaded/ebin/prim_file.beam Binary files differindex f375c05c99..3316e4348c 100644 --- a/erts/preloaded/ebin/prim_file.beam +++ b/erts/preloaded/ebin/prim_file.beam diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl index 41ff38359c..517ca74301 100644 --- a/erts/preloaded/src/prim_file.erl +++ b/erts/preloaded/src/prim_file.erl @@ -580,15 +580,20 @@ read_link_info(Name, Opts) -> read_info_1(Name, 0, proplist_get_value(time, Opts, local)). read_info_1(Name, FollowLinks, TimeType) -> - try read_info_nif(encode_path(Name), FollowLinks) of - {error, Reason} -> {error, Reason}; - FileInfo -> - CTime = from_posix_seconds(FileInfo#file_info.ctime, TimeType), - MTime = from_posix_seconds(FileInfo#file_info.mtime, TimeType), - ATime = from_posix_seconds(FileInfo#file_info.atime, TimeType), - {ok, FileInfo#file_info{ ctime = CTime, mtime = MTime, atime = ATime }} + try + case read_info_nif(encode_path(Name), FollowLinks) of + {error, Reason} -> + {error, Reason}; + FileInfo -> + CTime = from_posix_seconds(FileInfo#file_info.ctime, TimeType), + MTime = from_posix_seconds(FileInfo#file_info.mtime, TimeType), + ATime = from_posix_seconds(FileInfo#file_info.atime, TimeType), + {ok, FileInfo#file_info{ ctime = CTime, + mtime = MTime, + atime = ATime }} + end catch - error:badarg -> {error, badarg} + error:_ -> {error, badarg} end. write_file_info(Filename, Info) -> |