mirror of
https://github.com/adulau/ssldump.git
synced 2024-11-23 09:57:05 +00:00
Fix problematic fdatasync() call on macOS
The fdatasync call generates a "implicit declaration of function 'fdatasync' is invalid in C99" warning when building for macOS (it's nowhere to be found in the system includes), but linking will eventually work fine because there is an unrelated syscall by the same name (different prototype), so it's not doing what it should. So lets not use it.
This commit is contained in:
parent
89ed604ddc
commit
e5f2916b65
1 changed files with 5 additions and 1 deletions
|
@ -54,7 +54,11 @@ static int init_pcap_logger(void *data) {
|
|||
}
|
||||
|
||||
static int deinit_pcap_logger(void) {
|
||||
#if defined(_POSIX_SYNCHRONIZED_IO) && (_POSIX_SYNCHRONIZED_IO > 0)
|
||||
fdatasync(pcap_fd);
|
||||
#else
|
||||
fsync(pcap_fd);
|
||||
#endif
|
||||
close(pcap_fd);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue