fixed 64bit issue with file descriptor
authorMartin Willi <martin@strongswan.org>
Thu, 13 Sep 2007 08:19:15 +0000 (08:19 -0000)
committerMartin Willi <martin@strongswan.org>
Thu, 13 Sep 2007 08:19:15 +0000 (08:19 -0000)
src/charon/control/interfaces/xml_interface.c

index b295ec2..7710ae1 100644 (file)
@@ -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);