diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2019-05-27 11:57:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-05-28 10:36:09 +0200 |
commit | 5ec61261d9f8f426e492bb59390ef442ca7ef027 (patch) | |
tree | b18834933dbcf03d44b8e5057d6da6fb8639cd19 /scripts | |
parent | caf5b9f13d9d1ea6461cfa82276c0546b213adf8 (diff) | |
download | barebox-5ec61261d9f8f426e492bb59390ef442ca7ef027.tar.gz barebox-5ec61261d9f8f426e492bb59390ef442ca7ef027.tar.xz |
scripts: mkimage: s/fdatasync/fsync/ on macOS & OpenBSD
fdatasync is an optional part of POSIX and mkimage uses the more general
fsync on Sun and FreeBSD as an alternative. Add macOS[1] and OpenBSD to the
list as well.
This is in-line with what U-Boot does since 31cbe80c33
("mkimage: fix compilation issues on OpenBSD").
[1]: macOS >=10.7 does indeed define (but not declare anywhere) a seemingly
working fdatasync, but we won't consider this here.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mkimage.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/mkimage.c b/scripts/mkimage.c index 891d7b6de7..7d283c5509 100644 --- a/scripts/mkimage.c +++ b/scripts/mkimage.c @@ -572,7 +572,11 @@ NXTARG: ; } /* We're a bit of paranoid */ -#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__) +#if defined(_POSIX_SYNCHRONIZED_IO) && \ + !defined(__sun__) && \ + !defined(__FreeBSD__) && \ + !defined(__OpenBSD__) && \ + !defined(__APPLE__) (void) fdatasync (ifd); #else (void) fsync (ifd); @@ -622,7 +626,11 @@ NXTARG: ; (void) munmap((void *)ptr, sbuf.st_size); /* We're a bit of paranoid */ -#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__) +#if defined(_POSIX_SYNCHRONIZED_IO) && \ + !defined(__sun__) && \ + !defined(__FreeBSD__) && \ + !defined(__OpenBSD__) && \ + !defined(__APPLE__) (void) fdatasync (ifd); #else (void) fsync (ifd); |