diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-24 05:20:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-24 05:20:32 +0000 |
commit | 79255ac86cb86832fca4b5a326b2e5bf54d68d36 (patch) | |
tree | 85919429310565738989ddf6347ff596ecb9bc65 /file.c | |
parent | c97a6987b62726a20570fb06681c986cf7f60141 (diff) | |
download | ruby-79255ac86cb86832fca4b5a326b2e5bf54d68d36.tar.gz |
file.c: same timespec
* file.c (rb_file_s_utime): same timespec for same time object.
assume time objects are static.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2686,7 +2686,10 @@ rb_file_s_utime(int argc, VALUE *argv) if (!NIL_P(args.atime) || !NIL_P(args.mtime)) { tsp = tss; tsp[0] = rb_time_timespec(args.atime); - tsp[1] = rb_time_timespec(args.mtime); + if (args.atime == args.mtime) + tsp[1] = tsp[0]; + else + tsp[1] = rb_time_timespec(args.mtime); } args.tsp = tsp; |