diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 18:56:13 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-12-27 18:57:13 +0000 |
commit | 82dd75a7f436a19047325d62182590c9f9e23a78 (patch) | |
tree | 60ca20c8cf2b0d178d84725c0715471f76df97e1 /grp/tst_fgetgrent.c | |
parent | 0bbb676a2342367c4e52b35e890f24667dabb348 (diff) | |
parent | 963c37d5c0eb62b38f8764b23931c0dcdd497a13 (diff) |
Merge commit 'refs/top-bases/t/tls' into t/tls
Diffstat (limited to 'grp/tst_fgetgrent.c')
-rw-r--r-- | grp/tst_fgetgrent.c | 12 |
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) |