Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add mkdtemp to libnbcompat, since glibc doesn't have it an m...
details: https://anonhg.NetBSD.org/src/rev/7f954263492b
branches: trunk
changeset: 524847:7f954263492b
user: bjh21 <bjh21%NetBSD.org@localhost>
date: Sun Mar 31 18:04:11 2002 +0000
description:
Add mkdtemp to libnbcompat, since glibc doesn't have it an mktemp(1) will
need it.
diffstat:
lib/libc/stdio/gettemp.c | 11 +++++++++--
lib/libc/stdio/mkdtemp.c | 14 ++++++++++++--
tools/compat/Makefile | 7 ++++---
tools/compat/config.h.in | 3 ++-
tools/compat/configure | 2 +-
tools/compat/configure.ac | 4 ++--
6 files changed, 30 insertions(+), 11 deletions(-)
diffs (149 lines):
diff -r faabb3a05830 -r 7f954263492b lib/libc/stdio/gettemp.c
--- a/lib/libc/stdio/gettemp.c Sun Mar 31 17:56:54 2002 +0000
+++ b/lib/libc/stdio/gettemp.c Sun Mar 31 18:04:11 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gettemp.c,v 1.5 1999/09/20 04:39:30 lukem Exp $ */
+/* $NetBSD: gettemp.c,v 1.6 2002/03/31 18:04:13 bjh21 Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: gettemp.c,v 1.5 1999/09/20 04:39:30 lukem Exp $");
+__RCSID("$NetBSD: gettemp.c,v 1.6 2002/03/31 18:04:13 bjh21 Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -53,7 +53,13 @@
#include <stdlib.h>
#include <unistd.h>
+#if HAVE_CONFIG_H
+#include "config.h"
+#else
#include "local.h"
+#endif
+
+#if !HAVE_MKDTEMP
int
__gettemp(path, doopen, domkdir)
@@ -158,3 +164,4 @@
}
/*NOTREACHED*/
}
+#endif
diff -r faabb3a05830 -r 7f954263492b lib/libc/stdio/mkdtemp.c
--- a/lib/libc/stdio/mkdtemp.c Sun Mar 31 17:56:54 2002 +0000
+++ b/lib/libc/stdio/mkdtemp.c Sun Mar 31 18:04:11 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkdtemp.c,v 1.3 1999/09/20 04:39:31 lukem Exp $ */
+/* $NetBSD: mkdtemp.c,v 1.4 2002/03/31 18:04:13 bjh21 Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: mkdtemp.c,v 1.3 1999/09/20 04:39:31 lukem Exp $");
+__RCSID("$NetBSD: mkdtemp.c,v 1.4 2002/03/31 18:04:13 bjh21 Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -47,7 +47,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+
+#if HAVE_CONFIG_H
+#include "config.h"
+extern int __gettemp(char *, int *, int);
+#else
#include "local.h"
+#endif
+
+#if !HAVE_MKDTEMP
char *
mkdtemp(path)
@@ -57,3 +65,5 @@
return (__gettemp(path, (int *)NULL, 1) ? path : (char *)NULL);
}
+
+#endif
diff -r faabb3a05830 -r 7f954263492b tools/compat/Makefile
--- a/tools/compat/Makefile Sun Mar 31 17:56:54 2002 +0000
+++ b/tools/compat/Makefile Sun Mar 31 18:04:11 2002 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.9 2002/03/31 12:58:54 bjh21 Exp $
+# $NetBSD: Makefile,v 1.10 2002/03/31 18:04:11 bjh21 Exp $
HOSTLIB= nbcompat
SRCS= basename.c dirname.c fgetln.c flock.c fparseln.c \
- getmode.c getopt_long.c libyywrap.c \
- md2c.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c pread.c \
+ getmode.c getopt_long.c gettemp.c libyywrap.c \
+ md2c.c md2hl.c md4c.c md4hl.c md5c.c md5hl.c mkdtemp.c pread.c \
pwcache.c pwrite.c pw_scan.c rmd160.c rmd160hl.c setenv.c \
setgroupent.c setpassent.c setprogname.c sha1.c sha1hl.c \
snprintf.c strlcat.c strlcpy.c strmode.c strsep.c \
@@ -21,6 +21,7 @@
.PATH: ${.CURDIR}/../../lib/libc/gen \
${.CURDIR}/../../lib/libc/hash \
${.CURDIR}/../../lib/libc/md \
+ ${.CURDIR}/../../lib/libc/stdio \
${.CURDIR}/../../lib/libc/stdlib \
${.CURDIR}/../../lib/libc/string \
${.CURDIR}/../../lib/libutil \
diff -r faabb3a05830 -r 7f954263492b tools/compat/config.h.in
--- a/tools/compat/config.h.in Sun Mar 31 17:56:54 2002 +0000
+++ b/tools/compat/config.h.in Sun Mar 31 18:04:11 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: config.h.in,v 1.12 2002/03/31 12:58:54 bjh21 Exp $ */
+/* $NetBSD: config.h.in,v 1.13 2002/03/31 18:04:12 bjh21 Exp $ */
#ifndef __NETBSD_COMPAT_CONFIG_H__
#define __NETBSD_COMPAT_CONFIG_H__
@@ -62,6 +62,7 @@
#undef HAVE_LCHMOD
#undef HAVE_LCHOWN
#undef HAVE_LUTIMES
+#undef HAVE_MKDTEMP
#undef HAVE_PREAD
#undef HAVE_PWCACHE_USERDB
#undef HAVE_PWRITE
diff -r faabb3a05830 -r 7f954263492b tools/compat/configure
--- a/tools/compat/configure Sun Mar 31 17:56:54 2002 +0000
+++ b/tools/compat/configure Sun Mar 31 18:04:11 2002 +0000
@@ -4250,7 +4250,7 @@
for ac_func in asprintf asnprintf basename dirfd dirname \
fgetln flock fparseln futimes getopt getopt_long \
- isblank lchmod lchown lutimes pread pwcache_userdb \
+ isblank lchmod lchown lutimes mkdtemp pread pwcache_userdb \
pwrite setenv setgroupent setprogname setpassent \
snprintf strlcat strlcpy strsep vasprintf vasnprintf vsnprintf
do
diff -r faabb3a05830 -r 7f954263492b tools/compat/configure.ac
--- a/tools/compat/configure.ac Sun Mar 31 17:56:54 2002 +0000
+++ b/tools/compat/configure.ac Sun Mar 31 18:04:11 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.12 2002/03/31 12:58:54 bjh21 Exp $
+# $NetBSD: configure.ac,v 1.13 2002/03/31 18:04:12 bjh21 Exp $
#
# Autoconf definition file for libnbcompat.
#
@@ -88,7 +88,7 @@
AC_SEARCH_LIBS(fparseln, util)
AC_CHECK_FUNCS(asprintf asnprintf basename dirfd dirname \
fgetln flock fparseln futimes getopt getopt_long \
- isblank lchmod lchown lutimes pread pwcache_userdb \
+ isblank lchmod lchown lutimes mkdtemp pread pwcache_userdb \
pwrite setenv setgroupent setprogname setpassent \
snprintf strlcat strlcpy strsep vasprintf vasnprintf vsnprintf)
Home |
Main Index |
Thread Index |
Old Index