linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] fanotify.7: allow relative paths in example
@ 2014-11-03 18:06 Heinrich Schuchardt
       [not found] ` <1415037998-3821-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2014-11-03 18:06 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, Heinrich Schuchardt

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 pathes.

Signed-off-by: Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
---
 man7/fanotify.7 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man7/fanotify.7 b/man7/fanotify.7
index d6f2542..27bd0f8 100644
--- a/man7/fanotify.7
+++ b/man7/fanotify.7
@@ -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);
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] fanotify.7: allow relative paths in example
       [not found] ` <1415037998-3821-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
@ 2014-11-11  5:38   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-11-11  5:38 UTC (permalink / raw)
  To: Heinrich Schuchardt
  Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
	linux-man-u79uwXL29TY76Z2rM5mHXA

On 11/03/2014 07:06 PM, Heinrich Schuchardt wrote:
> 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 pathes.

Thanks, Heinrich. Applied.

Cheers,

Michael

> Signed-off-by: Heinrich Schuchardt <xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
> ---
>  man7/fanotify.7 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man7/fanotify.7 b/man7/fanotify.7
> index d6f2542..27bd0f8 100644
> --- a/man7/fanotify.7
> +++ b/man7/fanotify.7
> @@ -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);
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-11  5:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03 18:06 [PATCH 1/1] fanotify.7: allow relative paths in example Heinrich Schuchardt
     [not found] ` <1415037998-3821-1-git-send-email-xypron.glpk-Mmb7MZpHnFY@public.gmane.org>
2014-11-11  5:38   ` Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).