diff options
Diffstat (limited to 'tools/lib/api/fd')
| -rw-r--r-- | tools/lib/api/fd/array.c | 5 | ||||
| -rw-r--r-- | tools/lib/api/fd/array.h | 4 | 
2 files changed, 6 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)  }  int fdarray__filter(struct fdarray *fda, short revents, -		    void (*entry_destructor)(struct fdarray *fda, int fd)) +		    void (*entry_destructor)(struct fdarray *fda, int fd, void *arg), +		    void *arg)  {  	int fd, nr = 0; @@ -95,7 +96,7 @@ int fdarray__filter(struct fdarray *fda, short revents,  	for (fd = 0; fd < fda->nr; ++fd) {  		if (fda->entries[fd].revents & revents) {  			if (entry_destructor) -				entry_destructor(fda, fd); +				entry_destructor(fda, fd, arg);  			continue;  		} diff --git a/tools/lib/api/fd/array.h b/tools/lib/api/fd/array.h index 45db01818f45..71287dddc05f 100644 --- a/tools/lib/api/fd/array.h +++ b/tools/lib/api/fd/array.h @@ -22,6 +22,7 @@ struct fdarray {  	struct pollfd *entries;  	union {  		int    idx; +		void   *ptr;  	} *priv;  }; @@ -34,7 +35,8 @@ void fdarray__delete(struct fdarray *fda);  int fdarray__add(struct fdarray *fda, int fd, short revents);  int fdarray__poll(struct fdarray *fda, int timeout);  int fdarray__filter(struct fdarray *fda, short revents, -		    void (*entry_destructor)(struct fdarray *fda, int fd)); +		    void (*entry_destructor)(struct fdarray *fda, int fd, void *arg), +		    void *arg);  int fdarray__grow(struct fdarray *fda, int extra);  int fdarray__fprintf(struct fdarray *fda, FILE *fp); |