aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/api
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib/api')
-rw-r--r--tools/lib/api/fd/array.c5
-rw-r--r--tools/lib/api/fd/array.h3
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
87int fdarray__filter(struct fdarray *fda, short revents, 87int 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);
34int fdarray__add(struct fdarray *fda, int fd, short revents); 34int fdarray__add(struct fdarray *fda, int fd, short revents);
35int fdarray__poll(struct fdarray *fda, int timeout); 35int fdarray__poll(struct fdarray *fda, int timeout);
36int fdarray__filter(struct fdarray *fda, short revents, 36int 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);
38int fdarray__grow(struct fdarray *fda, int extra); 39int fdarray__grow(struct fdarray *fda, int extra);
39int fdarray__fprintf(struct fdarray *fda, FILE *fp); 40int fdarray__fprintf(struct fdarray *fda, FILE *fp);
40 41