$NetBSD: patch-aa,v 1.2 2009/08/03 13:57:14 joerg Exp $

--- unionfs.c.orig	2007-02-09 16:17:37.000000000 +0000
+++ unionfs.c
@@ -10,6 +10,7 @@ This is offered under a BSD-style licens
 #endif
 
 #include <fuse.h>
+#include <fuse_opt.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -192,7 +193,7 @@ static int unionfs_fsync(const char *pat
 
 	int res;
 	if (isdatasync) {
-#ifdef _POSIX_SYNCHRONIZED_IO
+#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO != -1
 		res = fdatasync(fi->fh);
 #else
 		res = fsync(fi->fh);
