Skip to content

Commit 7aba6de

Browse files
authored
stream: Fix MacOS build. fsync as alias for fdatasync. (php#6882)
If fdatasync is not available, use fsync instead. For some reason, fdatasync is available when using clang from Xcode, even though no declaration is present in headers.
1 parent 533a6bc commit 7aba6de

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ asctime_r \
548548
chroot \
549549
ctime_r \
550550
explicit_memset \
551+
fdatasync \
551552
flock \
552553
ftok \
553554
funopen \

main/streams/plain_wrapper.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ extern int php_get_gid_by_name(const char *name, gid_t *gid);
5858
#define fdatasync fsync
5959
#else
6060
# define PLAIN_WRAP_BUF_SIZE(st) (st)
61+
# if !defined(HAVE_FDATASYNC)
62+
# define fdatasync fsync
63+
# endif
6164
#endif
6265

6366
/* parse standard "fopen" modes into open() flags */

0 commit comments

Comments
 (0)