| 575 | } |
| 576 | |
| 577 | static bool posix_log_refresh_locked(const posix_log_path_t *path, int fd, |
| 578 | struct stat *status_out) { |
| 579 | struct stat current; |
| 580 | struct stat by_path; |
| 581 | if (!fd_regular_current_user(fd, ¤t) || current.st_size < 0 || |
| 582 | fstatat(path->dir_fd, path->base, &by_path, AT_SYMLINK_NOFOLLOW) != 0 || |
| 583 | !S_ISREG(by_path.st_mode) || current.st_dev != by_path.st_dev || |
| 584 | current.st_ino != by_path.st_ino) { |
| 585 | return false; |
| 586 | } |
| 587 | *status_out = current; |
| 588 | return true; |
| 589 | } |
| 590 | |
| 591 | static bool posix_log_append(const char *log_path, const char *record, size_t record_length, |
| 592 | size_t cap_bytes) { |
no test coverage detected