26 lines
698 B
Plaintext
26 lines
698 B
Plaintext
$OpenBSD: patch-libkmid_midfile_cc,v 1.2 2001/03/12 16:15:20 espie Exp $
|
|
--- libkmid/midfile.cc.orig Thu Jul 27 03:10:56 2000
|
|
+++ libkmid/midfile.cc Sat Mar 10 15:48:54 2001
|
|
@@ -59,16 +59,16 @@ int uncompressFile(const char *gzname, c
|
|
{
|
|
fprintf(stderr,"ERROR : popen failed : %s\n",cmd);
|
|
}
|
|
- char *tmp=tempnam(NULL,"KMid");
|
|
- if (tmp==NULL)
|
|
+ strcpy(tmpname, "/tmp/KMid.XXXXXXXXXX");
|
|
+ int fd = mkstemp(tmpname);
|
|
+ if (fd == -1)
|
|
{
|
|
pclose(infile);
|
|
delete cmd;
|
|
return 1;
|
|
}
|
|
- strcpy(tmpname,tmp);
|
|
- FILE *outfile= fopen(tmpname,"wb");
|
|
- if (outfile==NULL)
|
|
+ FILE *outfile = fdopen(fd, "wb");
|
|
+ if (outfile == NULL)
|
|
{
|
|
pclose(infile);
|
|
delete cmd;
|