Libraries updates and cleanup

* Updating common/lib
 * Updating lib/csu
 * Updating lib/libc
 * Updating libexec/ld.elf_so
 * Corrected test on __minix in featuretest to actually follow the
   meaning of the comment.
 * Cleaned up _REENTRANT-related defintions.
 * Disabled -D_REENTRANT for libfetch
 * Removing some unneeded __NBSD_LIBC defines and tests

Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
This commit is contained in:
2012-11-15 12:06:41 +01:00
parent f6aac1c3b5
commit f14fb60209
1285 changed files with 44244 additions and 14308 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: gettemp.c,v 1.14 2008/10/20 10:28:38 apb Exp $ */
/* $NetBSD: gettemp.c,v 1.15 2012/03/15 18:22:30 christos Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: gettemp.c,v 1.14 2008/10/20 10:28:38 apb Exp $");
__RCSID("$NetBSD: gettemp.c,v 1.15 2012/03/15 18:22:30 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -64,10 +64,7 @@ __RCSID("$NetBSD: gettemp.c,v 1.14 2008/10/20 10:28:38 apb Exp $");
#endif
int
GETTEMP(path, doopen, domkdir)
char *path;
int *doopen;
int domkdir;
GETTEMP(char *path, int *doopen, int domkdir)
{
char *start, *trv;
struct stat sbuf;
@@ -124,10 +121,10 @@ GETTEMP(path, doopen, domkdir)
if (*trv == '/') {
*trv = '\0';
if (stat(path, &sbuf))
return (0);
return 0;
if (!S_ISDIR(sbuf.st_mode)) {
errno = ENOTDIR;
return (0);
return 0;
}
*trv = '/';
break;
@@ -138,21 +135,21 @@ GETTEMP(path, doopen, domkdir)
if (doopen) {
if ((*doopen =
open(path, O_CREAT | O_EXCL | O_RDWR, 0600)) >= 0)
return (1);
return 1;
if (errno != EEXIST)
return (0);
return 0;
} else if (domkdir) {
if (mkdir(path, 0700) >= 0)
return (1);
return 1;
if (errno != EEXIST)
return (0);
return 0;
} else if (lstat(path, &sbuf))
return (errno == ENOENT ? 1 : 0);
return errno == ENOENT ? 1 : 0;
/* tricky little algorithm for backward compatibility */
for (trv = start;;) {
if (!*trv)
return (0);
return 0;
if (*trv == 'z')
*trv++ = 'a';
else {