Skip to content

Commit ee4eb7b

Browse files
committed
Added additional match cases for all FAN_EVENT_INFO_TYPE_NAME info_types
1 parent efcc1ef commit ee4eb7b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/sys/fanotify.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl FanotifyFidRecord {
251251
/// differs depending on the host system. Please read the statfs(2) documentation
252252
/// for more information:
253253
/// https://man7.org/linux/man-pages/man2/statfs.2.html#VERSIONS
254-
pub fn fsid(&self) -> libc::__kernel_fsid_t {
254+
pub fn filesystem_id(&self) -> libc::__kernel_fsid_t {
255255
self.0.fsid
256256
}
257257

@@ -595,7 +595,14 @@ impl Fanotify {
595595
);
596596

597597
let info_record = match header.info_type {
598-
libc::FAN_EVENT_INFO_TYPE_FID => {
598+
// FanotifyFidRecord can be returned for any of the following info_type.
599+
// This isn't found in the fanotify(7) documentation, but the fanotify_init(2) documentation
600+
// https://man7.org/linux/man-pages/man2/fanotify_init.2.html
601+
libc::FAN_EVENT_INFO_TYPE_FID
602+
| libc::FAN_EVENT_INFO_TYPE_DFID
603+
| libc::FAN_EVENT_INFO_TYPE_DFID_NAME
604+
| libc::FAN_EVENT_INFO_TYPE_NEW_DFID_NAME
605+
| libc::FAN_EVENT_INFO_TYPE_OLD_DFID_NAME => {
599606
let record = self
600607
.get_struct::<libc::fanotify_event_info_fid>(
601608
&buffer,

0 commit comments

Comments
 (0)