summaryrefslogtreecommitdiff
path: root/examples/detect.c
diff options
context:
space:
mode:
authorLinus Walleij <triad@df.lth.se>2006-06-19 09:31:53 +0000
committerLinus Walleij <triad@df.lth.se>2006-06-19 09:31:53 +0000
commitcf223e6b5e5d02b74da8d1388ff50a85ad30c849 (patch)
treeedace405bbf6ba906888155d989318813d643494 /examples/detect.c
parentd14e84ff2651fadb38265ecce5ca12121cedf0c4 (diff)
downloadlibmtp-cf223e6b5e5d02b74da8d1388ff50a85ad30c849.tar.gz
Several new track props and other fixes.
Diffstat (limited to 'examples/detect.c')
-rw-r--r--examples/detect.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/detect.c b/examples/detect.c
index a7ab345..c2a0c32 100644
--- a/examples/detect.c
+++ b/examples/detect.c
@@ -151,8 +151,9 @@ int main (int argc, char **argv)
}
}
if (xmlfileid != 0) {
- char tmpfilename[] = "WMPInfo.xml.XXXXXX";
- int tmpfile = mkstemp(tmpfilename);
+ FILE *xmltmp = tmpfile();
+ int tmpfile = fileno(xmltmp);
+
if (tmpfile != -1) {
int ret = LIBMTP_Get_Track_To_File_Descriptor(device, xmlfileid, tmpfile, NULL, NULL);
if (ret == 0) {
@@ -172,7 +173,7 @@ int main (int argc, char **argv)
dump_xml_fragment(buf, readbytes);
}
}
- close(tmpfile);
+ fclose(xmltmp);
}
}