diff options
Diffstat (limited to 'tools/lib/api')
-rw-r--r-- | tools/lib/api/fd/array.c | 5 | ||||
-rw-r--r-- | tools/lib/api/fd/array.h | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/tools/lib/api/fd/array.c b/tools/lib/api/fd/array.c index 0e636c4339b8..b0a035fc87b3 100644 --- a/tools/lib/api/fd/array.c +++ b/tools/lib/api/fd/array.c | |||
@@ -85,7 +85,8 @@ int fdarray__add(struct fdarray *fda, int fd, short revents) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | int fdarray__filter(struct fdarray *fda, short revents, | 87 | int fdarray__filter(struct fdarray *fda, short revents, |
88 | void (*entry_destructor)(struct fdarray *fda, int fd)) | 88 | void (*entry_destructor)(struct fdarray *fda, int fd, void *arg), |
89 | void *arg) | ||
89 | { | 90 | { |
90 | int fd, nr = 0; | 91 | int fd, nr = 0; |
91 | 92 | ||
@@ -95,7 +96,7 @@ int fdarray__filter(struct fdarray *fda, short revents, | |||
95 | for (fd = 0; fd < fda->nr; ++fd) { | 96 | for (fd = 0; fd < fda->nr; ++fd) { |
96 | if (fda->entries[fd].revents & revents) { | 97 | if (fda->entries[fd].revents & revents) { |
97 | if (entry_destructor) | 98 | if (entry_destructor) |
98 | entry_destructor(fda, fd); | 99 | entry_destructor(fda, fd, arg); |
99 | 100 | ||
100 | continue; | 101 | continue; |
101 | } | 102 | } |
diff --git a/tools/lib/api/fd/array.h b/tools/lib/api/fd/array.h index 45db01818f45..e87fd800fa8d 100644 --- a/tools/lib/api/fd/array.h +++ b/tools/lib/api/fd/array.h | |||
@@ -34,7 +34,8 @@ void fdarray__delete(struct fdarray *fda); | |||
34 | int fdarray__add(struct fdarray *fda, int fd, short revents); | 34 | int fdarray__add(struct fdarray *fda, int fd, short revents); |
35 | int fdarray__poll(struct fdarray *fda, int timeout); | 35 | int fdarray__poll(struct fdarray *fda, int timeout); |
36 | int fdarray__filter(struct fdarray *fda, short revents, | 36 | int fdarray__filter(struct fdarray *fda, short revents, |
37 | void (*entry_destructor)(struct fdarray *fda, int fd)); | 37 | void (*entry_destructor)(struct fdarray *fda, int fd, void *arg), |
38 | void *arg); | ||
38 | int fdarray__grow(struct fdarray *fda, int extra); | 39 | int fdarray__grow(struct fdarray *fda, int extra); |
39 | int fdarray__fprintf(struct fdarray *fda, FILE *fp); | 40 | int fdarray__fprintf(struct fdarray *fda, FILE *fp); |
40 | 41 | ||