len = read(fd, (void *)&buf[0], sizeof(buf));
if (len < 0 && errno != EAGAIN) {
fprintf(stderr,
- "failed to read from fanotiify file descriptor."
+ "failed to read from fanotify file descriptor."
" %d:%s",
errno, strerror(errno));
exit(EXIT_FAILURE);
test_mkdir $dir || error "failed to create dir $dir"
- $fanotify_prog $DIR > $report &
+ stdbuf -o0 $fanotify_prog $DIR > $report &
pid=$!
sleep 1
stack_trap "rm -f $report"
echo "1234567890" > $file
- wait_update_cond localhost "stat -c %s $report" "-gt" "0" 30 ||
- error "fanotify did not report anything after 30 seconds"
+ wait_update_cond localhost "stat -c %s $report" "-gt" "0" 60 ||
+ error "fanotify did not report anything after 60 seconds"
grep -a -E "open.*:$file:" $report ||
error "no open event for writing $file"
grep -a -E "write.*:$file:" $report ||
> $report
cat $file
- wait_update_cond localhost "stat -c %s $report" "-gt" "0" 30 ||
- error "fanotify did not report anything after 30 seconds"
+ wait_update_cond localhost "stat -c %s $report" "-gt" "0" 60 ||
+ error "fanotify did not report anything after 60 seconds"
grep -a -E "open.*:$file:" $report ||
error "no open event for reading $file"
grep -a -E "read.*:$file:" $report ||