Ticket #61380: patch-fix-st_atim.diff

File patch-fix-st_atim.diff, 1.8 KB (added by 21stcaveman (Hamid Maadani), 4 years ago)
  • source3/libsmb/libsmb_stat.c

    diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c
    index 790934b..7372881 100644
    a b void setup_stat(struct stat *st, 
    102102        }
    103103
    104104        st->st_dev = dev;
    105         st->st_atim = access_time_ts;
    106         st->st_ctim = change_time_ts;
    107         st->st_mtim = write_time_ts;
     105        st->st_atimespec = access_time_ts;
     106        st->st_ctimespec = change_time_ts;
     107        st->st_mtimespec = write_time_ts;
    108108}
    109109
    110110void setup_stat_from_stat_ex(const struct stat_ex *stex,
    111111                             const char *fname,
    112112                             struct stat *st)
    113113{
    114         st->st_atim = stex->st_ex_atime;
    115         st->st_ctim = stex->st_ex_ctime;
    116         st->st_mtim = stex->st_ex_mtime;
     114        st->st_atimespec = stex->st_ex_atime;
     115        st->st_ctimespec = stex->st_ex_ctime;
     116        st->st_mtimespec = stex->st_ex_mtime;
    117117
    118118        st->st_mode = stex->st_ex_mode;
    119119        st->st_size = stex->st_ex_size;
  • source4/torture/libsmbclient/libsmbclient.c

    diff --git a/source4/torture/libsmbclient/libsmbclient.c b/source4/torture/libsmbclient/libsmbclient.c
    index 3f39925..0ed93da 100644
    a b static bool torture_libsmbclient_utimes(struct torture_context *tctx) 
    12311231        ret = smbc_fstat(fhandle, &st);
    12321232        torture_assert_int_not_equal(tctx, ret, -1, "smbc_fstat failed");
    12331233
    1234         tbuf[0] = convert_timespec_to_timeval(st.st_atim);
    1235         tbuf[1] = convert_timespec_to_timeval(st.st_mtim);
     1234        tbuf[0] = convert_timespec_to_timeval(st.st_atimespec);
     1235        tbuf[1] = convert_timespec_to_timeval(st.st_mtimespec);
    12361236
    12371237        tbuf[1] = timeval_add(&tbuf[1], 0, 100000); /* 100 msec */
    12381238
    static bool torture_libsmbclient_utimes(struct torture_context *tctx) 
    12441244
    12451245        torture_assert_int_equal(
    12461246                tctx,
    1247                 st.st_mtim.tv_nsec / 1000,
     1247                st.st_mtimespec.tv_nsec / 1000,
    12481248                tbuf[1].tv_usec,
    12491249                "smbc_utimes did not update msec");
    12501250