mirror of https://github.com/mkerrisk/man-pages
fanotify.7: Pass array to read(2) directly instead of a pointer to it
It doesn't make any sense to pass a pointer to the array to read(2). It might make sense to pass a pointer to the first element of the array, but that is already implicitly done when passing the array, which decays to that pointer, so it's simpler to pass the array. And anyway, the cast was unneeded, as any pointer is implicitly cast to `void *`. Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
c7e5aa83d2
commit
209e118e30
|
@ -818,7 +818,7 @@ handle_events(int fd)
|
|||
|
||||
/* Read some events */
|
||||
|
||||
len = read(fd, (void *) &buf, sizeof(buf));
|
||||
len = read(fd, buf, sizeof(buf));
|
||||
if (len == \-1 && errno != EAGAIN) {
|
||||
perror("read");
|
||||
exit(EXIT_FAILURE);
|
||||
|
@ -1111,7 +1111,7 @@ main(int argc, char **argv)
|
|||
|
||||
/* Read events from the event queue into a buffer */
|
||||
|
||||
len = read(fd, (void *) &events_buf, sizeof(events_buf));
|
||||
len = read(fd, events_buf, sizeof(events_buf));
|
||||
if (len == \-1 && errno != EAGAIN) {
|
||||
perror("read");
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
Loading…
Reference in New Issue