From: Greg Troxel Date: Tue, 3 Jun 2014 14:59:56 +0000 (-0400) Subject: Avoid using incomplete utimensat implementations. X-Git-Tag: 0.26-rc2~7 X-Git-Url: https://arthur.barton.de/gitweb/?p=bup.git;a=commitdiff_plain;h=27d68e9dce19954fc6a86884b5b76a696a710fe8 Avoid using incomplete utimensat implementations. At least NetBSD 6 has partial support for utimensat, implementing the function but not providing needed definitions via sys/stat.h as POSIX requires. Check for needed defines, and if missing, undefine HAVE_UTIMENSAT. Signed-Off-By: Greg Troxel Tested-By: Greg Troxel Reviewed-by: Rob Browning --- diff --git a/lib/bup/_helpers.c b/lib/bup/_helpers.c index ea49c0e..6957d2c 100644 --- a/lib/bup/_helpers.c +++ b/lib/bup/_helpers.c @@ -39,6 +39,14 @@ #define BUP_HAVE_FILE_ATTRS 1 #endif +/* + * Check for incomplete UTIMENSAT support (NetBSD 6), and if so, + * pretend we don't have it. + */ +#if !defined(AT_FDCWD) || !defined(AT_SYMLINK_NOFOLLOW) +#undef HAVE_UTIMENSAT +#endif + #ifndef FS_NOCOW_FL // Of course, this assumes it's a bitfield value. #define FS_NOCOW_FL 0