diff options
author | Martin Willi <martin@strongswan.org> | 2007-09-13 08:19:15 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2007-09-13 08:19:15 +0000 |
commit | 6baca3b2f1d0863d0caf4c7dc63530907193267b (patch) | |
tree | 2cedf5280ae580415d2701643dfaca0961f96874 /src/charon/control/interfaces/xml_interface.c | |
parent | 367f9f01f765f2d01e319b54cdbbfcf2be1d4e9c (diff) | |
download | strongswan-6baca3b2f1d0863d0caf4c7dc63530907193267b.tar.bz2 strongswan-6baca3b2f1d0863d0caf4c7dc63530907193267b.tar.xz |
fixed 64bit issue with file descriptor
Diffstat (limited to 'src/charon/control/interfaces/xml_interface.c')
-rw-r--r-- | src/charon/control/interfaces/xml_interface.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/charon/control/interfaces/xml_interface.c b/src/charon/control/interfaces/xml_interface.c index b295ec201..7710ae19c 100644 --- a/src/charon/control/interfaces/xml_interface.c +++ b/src/charon/control/interfaces/xml_interface.c @@ -291,6 +291,14 @@ static void request(xmlTextReaderPtr reader, char *id, int fd) } /** + * cleanup helper function for open file descriptors + */ +static void closefdp(int *fd) +{ + close(*fd); +} + +/** * read from a opened connection and process it */ static job_requeue_t process(int *fdp) @@ -301,7 +309,7 @@ static job_requeue_t process(int *fdp) xmlTextReaderPtr reader; char *id = NULL, *type = NULL; - pthread_cleanup_push((void*)close, (void*)fd); + pthread_cleanup_push((void*)closefdp, (void*)&fd); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate); len = read(fd, buffer, sizeof(buffer)); pthread_setcancelstate(oldstate, NULL); |