Add a hint explaining why and how -1 should be treated differently in the
future. Also make use of the helper function make_omit_timespec().
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
int64_t d;
struct timespec ret;
- if ((nt == 0) || (nt == (int64_t)-1)) {
- return (struct timespec){.tv_nsec = SAMBA_UTIME_OMIT};
+ if (nt == NTTIME_OMIT) {
+ return make_omit_timespec();
+ }
+ if (nt == NTTIME_FREEZE) {
+ /*
+ * This should be returned as SAMBA_UTIME_FREEZE in the
+ * future.
+ */
+ return make_omit_timespec();
+ }
+ if (nt > NTTIME_MAX) {
+ nt = NTTIME_MAX;
}
d = (int64_t)nt;