From 8bc21bafba627e34c96f5b14bb2231ea918bdcef Mon Sep 17 00:00:00 2001 From: Dmitry Chagin Date: Sun, 3 Apr 2016 06:33:16 +0000 Subject: [PATCH] Move Linux specific times tests up to guarantee the values are defined. CID: 1305178 Submitted by: pfg@ MFC after: 1 week --- sys/compat/linux/linux_misc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index cdadd41ecff..65a6081d0b6 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -895,13 +895,14 @@ linux_utimensat(struct thread *td, struct linux_utimensat_args *args) break; } timesp = times; - } - if (times[0].tv_nsec == UTIME_OMIT && times[1].tv_nsec == UTIME_OMIT) + if (times[0].tv_nsec == UTIME_OMIT && + times[1].tv_nsec == UTIME_OMIT) /* This breaks POSIX, but is what the Linux kernel does * _on purpose_ (documented in the man page for utimensat(2)), * so we must follow that behaviour. */ return (0); + } if (args->pathname != NULL) LCONVPATHEXIST_AT(td, args->pathname, &path, dfd);