From: Todd C. Miller Date: Fri, 10 Apr 2015 13:43:54 +0000 (-0600) Subject: Avoid struct assignment when stashing mtime since AIX at least uses X-Git-Tag: SUDO_1_8_14^2~165 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9240018ce4ebd8395874c279d91204577fcdeb48;p=sudo Avoid struct assignment when stashing mtime since AIX at least uses a struct st_timespec that differs from struct timespec. From Andrey Klyachkin. --- diff --git a/include/sudo_util.h b/include/sudo_util.h index 71402c3ff..1d7fb63c3 100644 --- a/include/sudo_util.h +++ b/include/sudo_util.h @@ -124,7 +124,7 @@ */ #if defined(SUDO_ST_MTIM) # if defined(HAVE_FUTIMENS) && defined(HAVE_UTIMENSAT) -# define mtim_get(_x, _y) ((_y) = (_x)->SUDO_ST_MTIM) +# define mtim_get(_x, _y) do { (_y).tv_sec = (_x)->SUDO_ST_MTIM.tv_sec; (_y).tv_nsec = (_x)->SUDO_ST_MTIM.tv_nsec; } while (0) # else # define mtim_get(_x, _y) do { (_y).tv_sec = (_x)->SUDO_ST_MTIM.tv_sec; (_y).tv_nsec = ((_x)->SUDO_ST_MTIM.tv_nsec / 1000) * 1000; } while (0) # endif