summaryrefslogtreecommitdiff
path: root/grp/tst_fgetgrent.c
diff options
context:
space:
mode:
Diffstat (limited to 'grp/tst_fgetgrent.c')
-rw-r--r--grp/tst_fgetgrent.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/grp/tst_fgetgrent.c b/grp/tst_fgetgrent.c
index 66717ed591..d612445fed 100644
--- a/grp/tst_fgetgrent.c
+++ b/grp/tst_fgetgrent.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1999.
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <unistd.h>
static int errors;
@@ -99,7 +100,14 @@ test_fgetgrent (const char *filename)
int
main (int argc, char *argv[])
{
- char *file = tmpnam (NULL);
+ char file[] = "/tmp/tst_fgetgrent.XXXXXX";
+ int fd = mkstemp (file);
+ if (fd == -1)
+ {
+ printf ("mkstemp failed: %m\n");
+ return 1;
+ }
+ close (fd);
int i = 0;
if (argc > 1)