Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/lib/libc/stdio Pull up revision 1.5 (requested by thorp...



details:   https://anonhg.NetBSD.org/src/rev/234aaf1c8d81
branches:  netbsd-1-6
changeset: 529586:234aaf1c8d81
user:      he <he%NetBSD.org@localhost>
date:      Sat Nov 30 14:58:56 2002 +0000

description:
Pull up revision 1.5 (requested by thorpej in ticket #806):
  Allow mktemp to build as a host tool.

diffstat:

 lib/libc/stdio/mkstemp.c |  19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diffs (52 lines):

diff -r 9b0d4481c131 -r 234aaf1c8d81 lib/libc/stdio/mkstemp.c
--- a/lib/libc/stdio/mkstemp.c  Sat Nov 30 14:58:34 2002 +0000
+++ b/lib/libc/stdio/mkstemp.c  Sat Nov 30 14:58:56 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkstemp.c,v 1.4 1999/09/20 04:39:31 lukem Exp $        */
+/*     $NetBSD: mkstemp.c,v 1.4.12.1 2002/11/30 14:58:56 he Exp $      */
 
 /*
  * Copyright (c) 1987, 1993
@@ -33,21 +33,32 @@
  * SUCH DAMAGE.
  */
 
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#if !HAVE_CONFIG_H || !HAVE_MKSTEMP
+
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
 #if 0
 static char sccsid[] = "@(#)mktemp.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: mkstemp.c,v 1.4 1999/09/20 04:39:31 lukem Exp $");
+__RCSID("$NetBSD: mkstemp.c,v 1.4.12.1 2002/11/30 14:58:56 he Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
+#if HAVE_CONFIG_H
+#define        GETTEMP         gettemp
+#else
 #include <assert.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include "local.h"
+#define        GETTEMP         __gettemp
+#endif
 
 int
 mkstemp(path)
@@ -57,5 +68,7 @@
 
        _DIAGASSERT(path != NULL);
 
-       return (__gettemp(path, &fd, 0) ? fd : -1);
+       return (GETTEMP(path, &fd, 0) ? fd : -1);
 }
+
+#endif /* !HAVE_CONFIG_H || !HAVE_MKSTEMP */



Home | Main Index | Thread Index | Old Index