mirror of git://sourceware.org/git/glibc.git
(main): Use tmpfile instead of tmpnam.
This commit is contained in:
parent
fda5aa66ed
commit
ba6088cf1f
|
@ -11,7 +11,6 @@ main (int argc, char *argv[])
|
||||||
int result = 0;
|
int result = 0;
|
||||||
struct mntent mef;
|
struct mntent mef;
|
||||||
struct mntent *mnt = &mef;
|
struct mntent *mnt = &mef;
|
||||||
char *name;
|
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
mef.mnt_fsname = strdupa ("/dev/hda1");
|
mef.mnt_fsname = strdupa ("/dev/hda1");
|
||||||
|
@ -29,8 +28,7 @@ main (int argc, char *argv[])
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
name = tmpnam (NULL);
|
fp = tmpfile ();
|
||||||
fp = fopen (name, "w+");
|
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
{
|
{
|
||||||
printf ("Cannot open temporary file: %m\n");
|
printf ("Cannot open temporary file: %m\n");
|
||||||
|
@ -75,8 +73,6 @@ main (int argc, char *argv[])
|
||||||
puts ("Error while reading written entry back in");
|
puts ("Error while reading written entry back in");
|
||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
remove (name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue