summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2011-07-07 11:19:36 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2011-07-07 14:34:13 +0100
commit7ac8c2a9f09d3f26823a8f30a776ed2e777ffe6f (patch)
tree033e3ad4c2001578bcda6f21317ad1794cb6c06f
parentce3f63c1925e646bc7feb4f82d6d999f4cd040eb (diff)
Ensure temporary file used to invoke xkbcomp is always removedxserver-cygwin-1.10.2-2
It was only being removed on error, not on success :S Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r--xkb/ddxList.c3
-rw-r--r--xkb/ddxLoad.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/xkb/ddxList.c b/xkb/ddxList.c
index ea356954c..85dd0501b 100644
--- a/xkb/ddxList.c
+++ b/xkb/ddxList.c
@@ -235,6 +235,9 @@ int rval;
buf = malloc(PATH_MAX * sizeof(char));
if (!buf) {
fclose(in);
+#if defined(WIN32) || defined(__CYGWIN__)
+ unlink(tmpname);
+#endif
return BadAlloc;
}
while ((status==Success)&&((tmp=fgets(buf,PATH_MAX,in))!=NULL)) {
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c
index 77a5d9555..ca42f93ab 100644
--- a/xkb/ddxLoad.c
+++ b/xkb/ddxLoad.c
@@ -278,6 +278,10 @@ XkbDDXCompileKeymapByNames( XkbDescPtr xkb,
nameRtrn[nameRtrnLen-1]= '\0';
}
free(buf);
+#if defined(WIN32) || defined(__CYGWIN__)
+ /* remove the temporary file */
+ unlink(tmpname);
+#endif
return TRUE;
}
else