fanotify.7: Allow relative paths in example

The current example code requires passing an absolute
path to the mount to be watched.

By passing AT_FDCWD to fanotify_mark it can use both
absolute and relative paths.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Heinrich Schuchardt 2014-11-03 19:06:38 +01:00 committed by Michael Kerrisk
parent 8e38f6d391
commit 943c52b7bb
1 changed files with 1 additions and 1 deletions

View File

@ -691,7 +691,7 @@ main(int argc, char *argv[])
file descriptor */
if (fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT,
FAN_OPEN_PERM | FAN_CLOSE_WRITE, \-1,
FAN_OPEN_PERM | FAN_CLOSE_WRITE, AT_FDCWD,
argv[1]) == \-1) {
perror("fanotify_mark");
exit(EXIT_FAILURE);