summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-07-20 12:47:11 -0400
committerQuentin Carbonneaux2014-07-20 12:53:04 -0400
commitab00c0bf43205f9cd540f1389ac4a2bf62cc8db2 (patch)
tree270a523f0d235e55db6e37514c36f2875b4d77b5
parentd344965b94e38f2138fd3e60e4077bbbd3147998 (diff)
expose file descriptors in evnt callbacks
-rw-r--r--evnt.c2
-rw-r--r--evnt.h2
-rw-r--r--exec.c2
-rw-r--r--main.c3
4 files changed, 5 insertions, 4 deletions
diff --git a/evnt.c b/evnt.c
index 9f92793..c1a215c 100644
--- a/evnt.c
+++ b/evnt.c
@@ -57,7 +57,7 @@ ev_loop()
i++;
continue;
}
- if (elist[i].f(flags, elist[i].p)) {
+ if (elist[i].f(elist[i].fd, flags, elist[i].p)) {
ne--;
memmove(&elist[i], &elist[i+1], (ne - i) * sizeof(E));
continue;
diff --git a/evnt.h b/evnt.h
index e224fd8..3b33f81 100644
--- a/evnt.h
+++ b/evnt.h
@@ -11,7 +11,7 @@ enum {
struct e {
int fd;
int flags;
- int (*f)(int, void *);
+ int (*f)(int, int, void *);
void *p;
};
diff --git a/exec.c b/exec.c
index 1135247..edb4ae8 100644
--- a/exec.c
+++ b/exec.c
@@ -197,7 +197,7 @@ struct Run {
};
static int
-runev(int flag, void *data)
+runev(int fd, int flag, void *data)
{
struct Run *r;
diff --git a/main.c b/main.c
index 52ea976..9b24c49 100644
--- a/main.c
+++ b/main.c
@@ -24,10 +24,11 @@ die(char *m)
}
static int
-gev(int flag, void *unused)
+gev(int fd, int flag, void *unused)
{
GEvent e;
+ (void) fd;
assert(flag == ERead && unused == 0);
while (g->nextevent(&e) != 0) {