diff options
author | Linus Walleij <triad@df.lth.se> | 2006-06-19 09:31:53 +0000 |
---|---|---|
committer | Linus Walleij <triad@df.lth.se> | 2006-06-19 09:31:53 +0000 |
commit | cf223e6b5e5d02b74da8d1388ff50a85ad30c849 (patch) | |
tree | edace405bbf6ba906888155d989318813d643494 /examples/detect.c | |
parent | d14e84ff2651fadb38265ecce5ca12121cedf0c4 (diff) | |
download | libmtp-cf223e6b5e5d02b74da8d1388ff50a85ad30c849.tar.gz |
Several new track props and other fixes.
Diffstat (limited to 'examples/detect.c')
-rw-r--r-- | examples/detect.c | 7 |
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); } } |