aboutsummaryrefslogtreecommitdiff
path: root/misc/tst-mntent.c
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2004-03-22 10:50:50 +0000
committerAndreas Jaeger <aj@suse.de>2004-03-22 10:50:50 +0000
commitba6088cf1fb9a38d04368e3db924236736d555d8 (patch)
treeaad5ae47c75dd13516dbb553148cdf5ef82c8c57 /misc/tst-mntent.c
parentfda5aa66ed254b050b45ec827558e355bca74fb6 (diff)
downloadglibc-ba6088cf1fb9a38d04368e3db924236736d555d8.zip
glibc-ba6088cf1fb9a38d04368e3db924236736d555d8.tar.gz
glibc-ba6088cf1fb9a38d04368e3db924236736d555d8.tar.bz2
(main): Use tmpfile instead of tmpnam.
Diffstat (limited to 'misc/tst-mntent.c')
-rw-r--r--misc/tst-mntent.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/misc/tst-mntent.c b/misc/tst-mntent.c
index ae96767..802b56e 100644
--- a/misc/tst-mntent.c
+++ b/misc/tst-mntent.c
@@ -11,7 +11,6 @@ main (int argc, char *argv[])
int result = 0;
struct mntent mef;
struct mntent *mnt = &mef;
- char *name;
FILE *fp;
mef.mnt_fsname = strdupa ("/dev/hda1");
@@ -29,8 +28,7 @@ main (int argc, char *argv[])
result = 1;
}
- name = tmpnam (NULL);
- fp = fopen (name, "w+");
+ fp = tmpfile ();
if (fp == NULL)
{
printf ("Cannot open temporary file: %m\n");
@@ -75,8 +73,6 @@ main (int argc, char *argv[])
puts ("Error while reading written entry back in");
result = 1;
}
-
- remove (name);
}
return result;