| 2556 | } |
| 2557 | |
| 2558 | static bool posix_directory_sync(int dir_fd) { |
| 2559 | if (dir_fd < 0) { |
| 2560 | return false; |
| 2561 | } |
| 2562 | int result; |
| 2563 | do { |
| 2564 | result = fsync(dir_fd); |
| 2565 | } while (result != 0 && errno == EINTR); |
| 2566 | if (result == 0) { |
| 2567 | return true; |
| 2568 | } |
| 2569 | |
| 2570 | int sync_error = errno; |
| 2571 | bool unsupported = sync_error == EINVAL; |
| 2572 | #ifdef ENOTSUP |
| 2573 | unsupported = unsupported || sync_error == ENOTSUP; |
| 2574 | #endif |
| 2575 | #ifdef EOPNOTSUPP |
| 2576 | unsupported = unsupported || sync_error == EOPNOTSUPP; |
| 2577 | #endif |
| 2578 | /* Some POSIX filesystems, including Darwin filesystems, do not expose a |
| 2579 | * directory-sync operation. Record contents are still fsynced before |
| 2580 | * publication, and the recovery state machine accepts either atomic |
| 2581 | * namespace outcome after a crash. */ |
| 2582 | return unsupported; |
| 2583 | } |
| 2584 | |
| 2585 | static bool posix_socket_link_pair_unlink_if_matches(const cbm_daemon_ipc_endpoint_t *endpoint, |
| 2586 | const posix_socket_identity_t *identity) { |
no outgoing calls
no test coverage detected