Put a 8 byte filetime from a struct timespec. Uses GMT.
****************************************************************************/
-_PUBLIC_ void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts)
+_PUBLIC_ NTTIME unix_timespec_to_nt_time(struct timespec ts)
{
uint64_t d;
if (ts.tv_sec ==0 && ts.tv_nsec == 0) {
- *nt = 0;
- return;
+ return 0;
}
if (ts.tv_sec == TIME_T_MAX) {
- *nt = 0x7fffffffffffffffLL;
- return;
+ return 0x7fffffffffffffffLL;
}
if (ts.tv_sec == (time_t)-1) {
- *nt = (uint64_t)-1;
- return;
+ return (uint64_t)-1;
}
d = ts.tv_sec;
/* d is now in 100ns units. */
d += (ts.tv_nsec / 100);
- *nt = d;
+ return d;
}
int timespec_compare(const struct timespec *ts1, const struct timespec *ts2);
void round_timespec_to_sec(struct timespec *ts);
void round_timespec_to_usec(struct timespec *ts);
-void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts);
+NTTIME unix_timespec_to_nt_time(struct timespec ts);
#endif /* _SAMBA_TIME_H_ */
return false;
}
- unix_timespec_to_nt_time(&tmp, b_time);
+ tmp = unix_timespec_to_nt_time(b_time);
d_printf("create_time: %s\n", nt_time_string(talloc_tos(), tmp));
- unix_timespec_to_nt_time(&tmp, a_time);
+ tmp = unix_timespec_to_nt_time(a_time);
d_printf("access_time: %s\n", nt_time_string(talloc_tos(), tmp));
- unix_timespec_to_nt_time(&tmp, m_time);
+ tmp = unix_timespec_to_nt_time(m_time);
d_printf("write_time: %s\n", nt_time_string(talloc_tos(), tmp));
- unix_timespec_to_nt_time(&tmp, c_time);
+ tmp = unix_timespec_to_nt_time(c_time);
d_printf("change_time: %s\n", nt_time_string(talloc_tos(), tmp));
d_printf("attributes: %s (%x)\n", attr_str(talloc_tos(), mode), mode);
TALLOC_FREE(snap_name);
continue;
}
- unix_timespec_to_nt_time(&tmp, b_time);
+ tmp = unix_timespec_to_nt_time(b_time);
d_printf("create_time: %s\n", nt_time_string(talloc_tos(), tmp));
- unix_timespec_to_nt_time(&tmp, a_time);
+ tmp = unix_timespec_to_nt_time(a_time);
d_printf("access_time: %s\n", nt_time_string(talloc_tos(), tmp));
- unix_timespec_to_nt_time(&tmp, m_time);
+ tmp =unix_timespec_to_nt_time(m_time);
d_printf("write_time: %s\n", nt_time_string(talloc_tos(), tmp));
- unix_timespec_to_nt_time(&tmp, c_time);
+ tmp = unix_timespec_to_nt_time(c_time);
d_printf("change_time: %s\n", nt_time_string(talloc_tos(), tmp));
d_printf("size: %d\n", (int)size);
}
dosattrib.info.info3.valid_flags = XATTR_DOSINFO_ATTRIB|
XATTR_DOSINFO_CREATE_TIME;
dosattrib.info.info3.attrib = dosmode;
- unix_timespec_to_nt_time(&dosattrib.info.info3.create_time,
+ dosattrib.info.info3.create_time = unix_timespec_to_nt_time(
smb_fname->st.st_ex_btime);
DEBUG(10,("set_ea_dos_attributes: set attribute 0x%x, btime = %s on file %s\n",