diff options
author | Björn-Egil Dahlberg <[email protected]> | 2011-12-02 20:05:08 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2011-12-08 14:12:01 +0100 |
commit | abaefc0452f5b40841562da0f215e7d1ac371f1b (patch) | |
tree | 8fcc85b07ba9c0bc5a5a776f8ab60b0a4a482723 /erts/preloaded | |
parent | cf50fadc0133a41e8c4a52c3db05a1d0d6186e7d (diff) | |
download | otp-abaefc0452f5b40841562da0f215e7d1ac371f1b.tar.gz otp-abaefc0452f5b40841562da0f215e7d1ac371f1b.tar.bz2 otp-abaefc0452f5b40841562da0f215e7d1ac371f1b.zip |
Let prim_file validate ctime in file_info
Diffstat (limited to 'erts/preloaded')
-rw-r--r-- | erts/preloaded/src/prim_file.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/erts/preloaded/src/prim_file.erl b/erts/preloaded/src/prim_file.erl index 87fdb3fb8f..507ac9c360 100644 --- a/erts/preloaded/src/prim_file.erl +++ b/erts/preloaded/src/prim_file.erl @@ -779,15 +779,17 @@ write_file_info_int(Port, File, gid=Gid, atime=Atime0, mtime=Mtime0, - ctime=Ctime}, + ctime=Ctime0}, TimeType) -> % Atime and/or Mtime might be undefined % - use localtime() for atime, if atime is undefined % - use atime as mtime if mtime is undefined + % - use mtime as ctime if ctime is undefined Atime = file_info_validate_atime(Atime0, TimeType), Mtime = file_info_validate_mtime(Mtime0, Atime), + Ctime = file_info_validate_ctime(Ctime0, Mtime), drv_command(Port, [?FILE_WRITE_INFO, int_to_int32bytes(Mode), @@ -807,6 +809,9 @@ file_info_validate_atime(undefined, epoch) -> datetime_to_epoch(erlang:universal file_info_validate_mtime(undefined, Atime) -> Atime; file_info_validate_mtime(Mtime, _) -> Mtime. +file_info_validate_ctime(undefined, Mtime) -> Mtime; +file_info_validate_ctime(Ctime, _) -> Ctime. + %% make_link/{2,3} make_link(Old, New) -> |