summaryrefslogtreecommitdiff
path: root/navit/xmlconfig.c
diff options
context:
space:
mode:
authorzaxl <zaxl@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-11-06 12:04:54 +0000
committerzaxl <zaxl@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-11-06 12:04:54 +0000
commitd74a4163561e21ef658aaa817e895eda637cbf35 (patch)
tree255a5227f78a9f8ed5fcbb39fe0b1e155ccc0d15 /navit/xmlconfig.c
parent6f8048b5793a239198a85161bba3e2251ca08ea0 (diff)
downloadnavit-d74a4163561e21ef658aaa817e895eda637cbf35.tar.gz
FIX:core: ezxml doesn't close negative fds when parsing file, provide a workaround
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1652 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/xmlconfig.c')
-rw-r--r--navit/xmlconfig.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/navit/xmlconfig.c b/navit/xmlconfig.c
index bedfc42dd..f153a08e3 100644
--- a/navit/xmlconfig.c
+++ b/navit/xmlconfig.c
@@ -796,8 +796,14 @@ parse_node(struct xmldocument *document, ezxml_t node)
static gboolean
parse_file(struct xmldocument *document, xmlerror **error)
{
- ezxml_t root = ezxml_parse_file(document->href);
-
+ int fd;
+ ezxml_t root;
+ /* BUG workaround: ezxml parse file leaves negative fds unclosed */
+ fd = open(document->href, O_RDONLY, 0);
+ if (fd == -1)
+ return FALSE;
+ root = ezxml_parse_fd(fd);
+ close(fd);
if (!root)
return FALSE;
document->active=document->xpointer ? 0:1;