Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for timestamp seconds count on 4.20 kernel. #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions exfat_oal.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ static time_t accum_days_in_year[] = {

TIMESTAMP_T *tm_current(TIMESTAMP_T *tp)
{
struct timespec ts;
time_t second, day, leap_day, month, year;

#if LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ktime_get_real_seconds() available on Linux kernels lower than 4.8.0 (looks like it was introduced in 3.19.0), is this #if really required at all?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as an FYI I have a working (built and tested this morning_ PR here: barrybingo#1

struct timespec ts;
ts = CURRENT_TIME_SEC;
second = ts.tv_sec;
#else
ktime_get_real_ts(&ts);
second = ktime_get_real_seconds();
#endif

second = ts.tv_sec;
second -= sys_tz.tz_minuteswest * SECS_PER_MIN;

/* Jan 1 GMT 00:00:00 1980. But what about another time zone? */
Expand Down