]> arthur.barton.de Git - bup.git/commitdiff
Avoid using incomplete utimensat implementations.
authorGreg Troxel <gdt@ir.bbn.com>
Tue, 3 Jun 2014 14:59:56 +0000 (10:59 -0400)
committerRob Browning <rlb@defaultvalue.org>
Tue, 10 Jun 2014 17:56:20 +0000 (12:56 -0500)
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 <gdt@ir.bbn.com>
Tested-By: Greg Troxel <gdt@ir.bbn.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/_helpers.c

index ea49c0e7571045484a35c73a7e07344607f822eb..6957d2cbe902486886b40c043ad3f342bc614727 100644 (file)
 #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