Bug #14862
utime.h: fix timezone issue in round_to_* funcs.
0%
Description
gmtime_r converts local time to UTC, however mktime only takes an argument as local time. Use localtime_r instead of gmtime_r will fix.
round_to_hour may be called by recalc_round_timestamp(ts) in rgw/rgw_log.cc:UsageLogger.
When system timezone setting is not UTC, the rgw_usage_log_entry will set wrong timestamp and epoch.
Related issues
Associated revisions
utime.h: fix timezone issue in round_to_* funcs.
gmtime_r converts local time to UTC, however mktime only takes an
argument as local time. Use localtime_r instead of gmtime_r will fix.
Fixes: #14862
Reported-by: isyippee <yippee_liu@163.com>
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
utime.h: fix timezone issue in round_to_* funcs.
gmtime_r converts local time to UTC, however mktime only takes an
argument as local time. Use localtime_r instead of gmtime_r will fix.
Fixes: #14862
Reported-by: isyippee <yippee_liu@163.com>
Signed-off-by: Zhao Chao <zhaochao1984@gmail.com>
(cherry picked from commit c914f28d6e79726b84261884c37b89d7c6b34f21)
History
#1 Updated by Chao Zhao about 8 years ago
#2 Updated by Nathan Cutler about 8 years ago
- Status changed from New to Fix Under Review
#3 Updated by Nathan Cutler almost 8 years ago
- Status changed from Fix Under Review to Resolved
#4 Updated by Nathan Cutler over 7 years ago
- Status changed from Resolved to Pending Backport
- Backport set to jewel
#5 Updated by Nathan Cutler over 7 years ago
- Duplicated by Bug #17200: utime.h: fix timezone issue in round_to_* funcs. added
#6 Updated by Nathan Cutler over 7 years ago
- Copied to Backport #17583: jewel: utime.h: fix timezone issue in round_to_* funcs. added
#7 Updated by Nathan Cutler about 7 years ago
- Status changed from Pending Backport to Resolved