Skip to content
Snippets Groups Projects
Commit b7eccf75 authored by Jan Kara's avatar Jan Kara
Browse files

samples: Fix warning in fsnotify sample


The fsnotify sample code generates the following warning on powerpc:

samples/fanotify/fs-monitor.c: In function 'handle_notifications':
samples/fanotify/fs-monitor.c:68:36: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=]
   68 |    printf("unexpected FAN MARK: %llx\n", event->mask);
      |                                 ~~~^     ~~~~~~~~~~~
      |                                    |          |
      |                                    |          __u64 {aka long unsigned int}
      |                                    long long unsigned int
      |                                 %lx

Fix the problem by explicitely typing the argument to proper type.

Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 9abeae5d
No related branches found
No related tags found
Loading
......@@ -65,7 +65,8 @@ static void handle_notifications(char *buffer, int len)
for (; FAN_EVENT_OK(event, len); event = FAN_EVENT_NEXT(event, len)) {
if (event->mask != FAN_FS_ERROR) {
printf("unexpected FAN MARK: %llx\n", event->mask);
printf("unexpected FAN MARK: %llx\n",
(unsigned long long)event->mask);
goto next_event;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment