aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2020-04-20 21:33:46 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2020-04-20 21:33:46 +0200
commit4c258dbcb9e52d878b8497ada4fe25cee8aa0af8 (patch)
treef29db300c72350311af4bbb93b0741738b717027
parent81daa1727defe942433b2e575fd084716b6e08f8 (diff)
downloadman-pages-4c258dbcb9e52d878b8497ada4fe25cee8aa0af8.tar.gz
fanotify.7: Wrap some long lines in example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man7/fanotify.721
1 files changed, 12 insertions, 9 deletions
diff --git a/man7/fanotify.7 b/man7/fanotify.7
index cd258abf4b..ac6fbbcaef 100644
--- a/man7/fanotify.7
+++ b/man7/fanotify.7
@@ -1087,7 +1087,8 @@ main(int argc, char **argv)
if (fid\->hdr.info_type == FAN_EVENT_INFO_TYPE_FID) {
file_name = NULL;
} else if (fid\->hdr.info_type == FAN_EVENT_INFO_TYPE_DFID_NAME) {
- file_name = file_handle->f_handle + file_handle->handle_bytes;
+ file_name = file_handle->f_handle +
+ file_handle->handle_bytes;
} else {
fprintf(stderr, "Received unexpected event info type.\en");
exit(EXIT_FAILURE);
@@ -1102,13 +1103,14 @@ main(int argc, char **argv)
if (metadata\->mask == (FAN_CREATE | FAN_ONDIR))
printf("FAN_CREATE | FAN_ONDIR (subdirectory created):\en");
- /* metadata\->fd is set to FAN_NOFD when FAN_REPORT_FID is enabled.
- To obtain a file descriptor for the file object corresponding to
- an event you can use the struct file_handle that\(aqs provided
- within the fanotify_event_info_fid in conjunction with the
- open_by_handle_at(2) system call. A check for ESTALE is done
- to accommodate for the situation where the file handle for the
- object was deleted prior to this system call. */
+ /* metadata\->fd is set to FAN_NOFD when FAN_REPORT_FID is
+ enabled. To obtain a file descriptor for the file object
+ corresponding to an event you can use the struct file_handle
+ that\(aqs provided within the fanotify_event_info_fid in
+ conjunction with the open_by_handle_at(2) system call.
+ A check for ESTALE is done to accommodate for the situation
+ where the file handle for the object was deleted prior to
+ this system call. */
event_fd = open_by_handle_at(mount_fd, file_handle, O_RDONLY);
if (event_fd == \-1) {
@@ -1147,7 +1149,8 @@ main(int argc, char **argv)
} else if ((sb.st_mode & S_IFMT) == S_IFDIR) {
printf("\etEntry \(aq%s\(aq is a subdirectory.\en", file_name);
} else {
- printf("\etEntry \(aq%s\(aq is not a subdirectory.\en", file_name);
+ printf("\etEntry \(aq%s\(aq is not a subdirectory.\en",
+ file_name);
}
}