From 5b7a9c2e7d8b68a0e6f71992d28bb565ea9b0d22 Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 27 Dec 2007 13:04:14 +0000 Subject: [PATCH] gcc/ada/ PR ada/34553 * adaint.c (__gnat_open_new_temp, __gnat_tmp_name): Use mkstemp() instead of mktemp() or tmpnam() on NetBSD. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131201 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/adaint.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 3f99566..5c26038 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2007-12-27 Samuel Tardieu + + PR ada/34553 + * adaint.c (__gnat_open_new_temp, __gnat_tmp_name): Use mkstemp() + instead of mktemp() or tmpnam() on NetBSD. + 2007-12-23 Eric Botcazou * trans.c (call_to_gnu): Make the temporary for non-addressable diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 6c5d440..1556b28 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -887,7 +887,8 @@ __gnat_open_new_temp (char *path, int fmode) strcpy (path, "GNAT-XXXXXX"); -#if (defined (__FreeBSD__) || defined (linux)) && !defined (__vxworks) +#if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (linux)) && \ + !defined (__vxworks) return mkstemp (path); #elif defined (__Lynx__) mktemp (path); @@ -979,7 +980,7 @@ __gnat_tmp_name (char *tmp_filename) free (pname); } -#elif defined (linux) || defined (__FreeBSD__) +#elif defined (linux) || defined (__FreeBSD__) || defined (__NetBSD__) #define MAX_SAFE_PATH 1000 char *tmpdir = getenv ("TMPDIR"); -- 2.7.4