From ba6088cf1fb9a38d04368e3db924236736d555d8 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 22 Mar 2004 10:50:50 +0000 Subject: (main): Use tmpfile instead of tmpnam. --- misc/tst-mntent.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'misc') 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; -- cgit v1.1