Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Avlasov <yavlasov@google.com>
  • Loading branch information
yanavlasov committed Aug 8, 2024
1 parent ef49204 commit f6816ef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/common/filesystem/inotify/watcher_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ absl::Status WatcherImpl::addWatch(absl::string_view path, uint32_t events, OnCh

absl::Status WatcherImpl::onInotifyEvent() {
while (true) {
// The buffer needs to be suitably aligned to store the first inotify_event structure.
// If there are multiple events returned by the read call, the kernel is responsible for
// properly aligning subsequent inotify_event structures (per `man inotify`).
alignas(inotify_event) uint8_t buffer[sizeof(inotify_event) + NAME_MAX + 1];
ssize_t rc = read(inotify_fd_, &buffer, sizeof(buffer));
if (rc == -1 && errno == EAGAIN) {
Expand Down

0 comments on commit f6816ef

Please sign in to comment.