summaryrefslogtreecommitdiff
path: root/plugins/gme
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-05-09 21:15:38 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-05-09 21:40:33 +0200
commit23c2f35e6bba40dd601117ebd4f69c09548badbb (patch)
treef31f07c95b06c5d8cc69d0c3bef425d9a53e031a /plugins/gme
parent3e0c8ac78e5e275a1067c07d1cf41aaf10b37683 (diff)
gme: android build fix
Diffstat (limited to 'plugins/gme')
-rw-r--r--plugins/gme/cgme.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/gme/cgme.c b/plugins/gme/cgme.c
index 557ec13f..712643e2 100644
--- a/plugins/gme/cgme.c
+++ b/plugins/gme/cgme.c
@@ -25,6 +25,7 @@
# include "../../config.h"
#endif
#include <stdio.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
@@ -84,8 +85,13 @@ read_gzfile (const char *fname, char **buffer, int *size) {
tmp = "/tmp";
}
char nm[PATH_MAX];
+#ifdef ANDROID
+ snprintf (nm, sizeof (nm), "%s/ddbgmeXXXXXX", tmp);
+ fd = mkstemp (nm);
+#else
snprintf (nm, sizeof (nm), "%s/ddbgmeXXXXXX.vgz", tmp);
fd = mkstemps (nm, 4);
+#endif
if (fd == -1 || sz != write (fd, buffer, sz)) {
trace ("gme read_gzfile: failed to write temp file\n");
if (fd != -1) {