]> granicus.if.org Git - sudo/commitdiff
Avoid struct assignment when stashing mtime since AIX at least uses
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 10 Apr 2015 13:43:54 +0000 (07:43 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 10 Apr 2015 13:43:54 +0000 (07:43 -0600)
a struct st_timespec that differs from struct timespec.
From Andrey Klyachkin.

include/sudo_util.h

index 71402c3ff6a7cd89137b377b0726836e56c398f0..1d7fb63c33522b1f2510298ad2f57c243434c8b0 100644 (file)
  */
 #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