Эх сурвалжийг харах

Convert all the rest, remove isxupper/isxlower, if someone objects, I'll add it back

Peter S. Mazinger 19 жил өмнө
parent
commit
403d3b6c02

+ 1 - 8
include/ctype.h

@@ -136,18 +136,11 @@ extern const __ctype_touplow_t *__ctype_tolower;
 #define	__isascii(c)	(((c) & ~0x7f) == 0)	/* If C is a 7 bit value.  */
 #define	__isascii(c)	(((c) & ~0x7f) == 0)	/* If C is a 7 bit value.  */
 #define	__toascii(c)	((c) & 0x7f)		/* Mask off high bits.  */
 #define	__toascii(c)	((c) & 0x7f)		/* Mask off high bits.  */
 
 
-#ifdef __USE_MISC
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
-
-/* The following are included for compatibility with older versions of
- * uClibc; but now they're only visible if MISC funcctionality is requested. */
-extern int isxlower(int c) __THROW;
-extern int isxupper(int c) __THROW;
-
 /* isdigit() is really locale-invariant, so provide some small fast macros.
 /* isdigit() is really locale-invariant, so provide some small fast macros.
  * These are uClibc-specific. */
  * These are uClibc-specific. */
 #define __isdigit_char(C)    (((unsigned char)((C) - '0')) <= 9)
 #define __isdigit_char(C)    (((unsigned char)((C) - '0')) <= 9)
 #define __isdigit_int(C)     (((unsigned int)((C) - '0')) <= 9)
 #define __isdigit_int(C)     (((unsigned int)((C) - '0')) <= 9)
-
 #endif
 #endif
 
 
 #define	__exctype(name)	extern int name (int) __THROW
 #define	__exctype(name)	extern int name (int) __THROW

+ 18 - 12
libc/misc/wordexp/wordexp.c

@@ -23,6 +23,8 @@
 #define stpcpy __stpcpy
 #define stpcpy __stpcpy
 #define strndup __strndup
 #define strndup __strndup
 #define strspn __strspn
 #define strspn __strspn
+#define strcspn __strcspn
+#define setenv __setenv
 #define unsetenv __unsetenv
 #define unsetenv __unsetenv
 #define waitpid __waitpid
 #define waitpid __waitpid
 #define kill __kill
 #define kill __kill
@@ -34,10 +36,7 @@
 #define atoi __atoi
 #define atoi __atoi
 #define fnmatch __fnmatch
 #define fnmatch __fnmatch
 #define pipe __pipe
 #define pipe __pipe
-#if 0
+#define fork __fork
-#define glob __glob
-#define globfree __globfree
-#endif
 
 
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -56,6 +55,12 @@
 #include <glob.h>
 #include <glob.h>
 #include <wordexp.h>
 #include <wordexp.h>
 
 
+extern void __wordfree (wordexp_t *__wordexp) __THROW attribute_hidden;
+extern int __glob (__const char *__restrict __pattern, int __flags,
+		 int (*__errfunc) (__const char *, int),
+		 glob_t *__restrict __pglob) __THROW attribute_hidden;
+extern void __globfree (glob_t *__pglob) __THROW attribute_hidden;
+
 #define __WORDEXP_FULL
 #define __WORDEXP_FULL
 //#undef __WORDEXP_FULL
 //#undef __WORDEXP_FULL
 
 
@@ -362,7 +367,7 @@ do_parse_glob(const char *glob_word, char **word, size_t * word_length,
 	int match;
 	int match;
 	glob_t globbuf;
 	glob_t globbuf;
 
 
-	error = glob(glob_word, GLOB_NOCHECK, NULL, &globbuf);
+	error = __glob(glob_word, GLOB_NOCHECK, NULL, &globbuf);
 
 
 	if (error != 0) {
 	if (error != 0) {
 		/* We can only run into memory problems.  */
 		/* We can only run into memory problems.  */
@@ -381,7 +386,7 @@ do_parse_glob(const char *glob_word, char **word, size_t * word_length,
 								 globbuf.gl_pathv[match]);
 								 globbuf.gl_pathv[match]);
 		}
 		}
 
 
-		globfree(&globbuf);
+		__globfree(&globbuf);
 		return *word ? 0 : WRDE_NOSPACE;
 		return *word ? 0 : WRDE_NOSPACE;
 	}
 	}
 
 
@@ -395,12 +400,12 @@ do_parse_glob(const char *glob_word, char **word, size_t * word_length,
 		char *matching_word = __strdup(globbuf.gl_pathv[match]);
 		char *matching_word = __strdup(globbuf.gl_pathv[match]);
 
 
 		if (matching_word == NULL || w_addword(pwordexp, matching_word)) {
 		if (matching_word == NULL || w_addword(pwordexp, matching_word)) {
-			globfree(&globbuf);
+			__globfree(&globbuf);
 			return WRDE_NOSPACE;
 			return WRDE_NOSPACE;
 		}
 		}
 	}
 	}
 
 
-	globfree(&globbuf);
+	__globfree(&globbuf);
 	return 0;
 	return 0;
 }
 }
 
 
@@ -483,7 +488,7 @@ parse_glob(char **word, size_t * word_length, size_t * max_length,
 
 
 	/* Now tidy up */
 	/* Now tidy up */
   tidy_up:
   tidy_up:
-	wordfree(&glob_list);
+	__wordfree(&glob_list);
 	return error;
 	return error;
 }
 }
 
 
@@ -2023,7 +2028,7 @@ parse_dquote(char **word, size_t * word_length, size_t * max_length,
  * wordfree() is to be called after pwordexp is finished with.
  * wordfree() is to be called after pwordexp is finished with.
  */
  */
 
 
-void wordfree(wordexp_t * pwordexp)
+void attribute_hidden __wordfree(wordexp_t * pwordexp)
 {
 {
 
 
 	/* wordexp can set pwordexp to NULL */
 	/* wordexp can set pwordexp to NULL */
@@ -2037,6 +2042,7 @@ void wordfree(wordexp_t * pwordexp)
 		pwordexp->we_wordv = NULL;
 		pwordexp->we_wordv = NULL;
 	}
 	}
 }
 }
+strong_alias(__wordfree,wordfree)
 
 
 /*
 /*
  * wordexp()
  * wordexp()
@@ -2055,7 +2061,7 @@ int wordexp(const char *words, wordexp_t * we, int flags)
 
 
 	if (flags & WRDE_REUSE) {
 	if (flags & WRDE_REUSE) {
 		/* Minimal implementation of WRDE_REUSE for now */
 		/* Minimal implementation of WRDE_REUSE for now */
-		wordfree(we);
+		__wordfree(we);
 		old_word.we_wordv = NULL;
 		old_word.we_wordv = NULL;
 	}
 	}
 
 
@@ -2257,7 +2263,7 @@ int wordexp(const char *words, wordexp_t * we, int flags)
 		return WRDE_NOSPACE;
 		return WRDE_NOSPACE;
 
 
 	if ((flags & WRDE_APPEND) == 0)
 	if ((flags & WRDE_APPEND) == 0)
-		wordfree(we);
+		__wordfree(we);
 
 
 	*we = old_word;
 	*we = old_word;
 	return error;
 	return error;

+ 5 - 2
libc/pwd_grp/pwd_grp.c

@@ -21,6 +21,7 @@
 #define setgroups __setgroups
 #define setgroups __setgroups
 #define strtoul __strtoul
 #define strtoul __strtoul
 #define rewind __rewind
 #define rewind __rewind
+#define fgets_unlocked __fgets_unlocked
 
 
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <features.h>
 #include <features.h>
@@ -51,6 +52,8 @@ extern int __getpwuid_r (__uid_t __uid,
 		       char *__restrict __buffer, size_t __buflen,
 		       char *__restrict __buffer, size_t __buflen,
 		       struct passwd **__restrict __result) attribute_hidden;
 		       struct passwd **__restrict __result) attribute_hidden;
 
 
+extern int __fputc_unlocked_internal(int c, FILE *stream) attribute_hidden;
+
 /**********************************************************************/
 /**********************************************************************/
 /* Sizes for staticly allocated buffers. */
 /* Sizes for staticly allocated buffers. */
 
 
@@ -806,7 +809,7 @@ int putgrent(const struct group *__restrict p, FILE *__restrict f)
 
 
 			do {
 			do {
 				if (!*m) {
 				if (!*m) {
-					if (fputc_unlocked('\n', f) >= 0) {
+					if (__fputc_unlocked_internal('\n', f) >= 0) {
 						rv = 0;
 						rv = 0;
 					}
 					}
 					break;
 					break;
@@ -872,7 +875,7 @@ int putspent(const struct spwd *p, FILE *stream)
 		goto DO_UNLOCK;
 		goto DO_UNLOCK;
 	}
 	}
 
 
-	if (fputc_unlocked('\n', stream) > 0) {
+	if (__fputc_unlocked_internal('\n', stream) > 0) {
 		rv = 0;
 		rv = 0;
 	}
 	}
 
 

+ 2 - 2
libc/stdlib/malloc/heap_debug.c

@@ -80,13 +80,13 @@ __heap_check_failure (struct heap *heap, struct heap_free_area *fa,
   vfprintf (stderr, fmt, val);
   vfprintf (stderr, fmt, val);
   va_end (val);
   va_end (val);
 
 
-  putc ('\n', stderr);
+  __putc ('\n', stderr);
 
 
   __malloc_debug_set_indent (0);
   __malloc_debug_set_indent (0);
   __malloc_debug_printf (1, "heap dump:");
   __malloc_debug_printf (1, "heap dump:");
   __heap_dump_freelist (heap);
   __heap_dump_freelist (heap);
 
 
-  exit (22);
+  __exit (22);
 }
 }
 
 
 /* Do some consistency checks on HEAP.  If they fail, output an error
 /* Do some consistency checks on HEAP.  If they fail, output an error

+ 2 - 0
libc/stdlib/malloc/malloc.h

@@ -79,6 +79,8 @@ extern struct heap __malloc_mmb_heap;
    to stderr, when the variable __malloc_mmb_debug is set to true. */
    to stderr, when the variable __malloc_mmb_debug is set to true. */
 #ifdef MALLOC_MMB_DEBUGGING
 #ifdef MALLOC_MMB_DEBUGGING
 # include <stdio.h>
 # include <stdio.h>
+extern int __putc(int c, FILE *stream) attribute_hidden;
+
 extern int __malloc_mmb_debug;
 extern int __malloc_mmb_debug;
 # define MALLOC_MMB_DEBUG(indent, fmt, args...)				      \
 # define MALLOC_MMB_DEBUG(indent, fmt, args...)				      \
    (__malloc_mmb_debug ? __malloc_debug_printf (indent, fmt , ##args) : 0)
    (__malloc_mmb_debug ? __malloc_debug_printf (indent, fmt , ##args) : 0)

+ 2 - 2
libc/stdlib/malloc/malloc_debug.c

@@ -42,7 +42,7 @@ __malloc_debug_printf (int indent, const char *fmt, ...)
 
 
   while (spaces > 0)
   while (spaces > 0)
     {
     {
-      putc (' ', stderr);
+      __putc (' ', stderr);
       spaces--;
       spaces--;
     }
     }
 
 
@@ -50,7 +50,7 @@ __malloc_debug_printf (int indent, const char *fmt, ...)
   vfprintf (stderr, fmt, val);
   vfprintf (stderr, fmt, val);
   va_end (val);
   va_end (val);
 
 
-  putc ('\n', stderr);
+  __putc ('\n', stderr);
 
 
   __malloc_debug_indent (indent);
   __malloc_debug_indent (indent);
 }
 }

+ 1 - 1
libc/stdlib/stdlib.c

@@ -724,7 +724,7 @@ unsigned long long attribute_hidden __XL_NPP(_stdlib_strto_ll)(register const Wc
 
 
 /*  void _Exit(int status) */
 /*  void _Exit(int status) */
 /*  { */
 /*  { */
-/*  	_exit(status); */
+/*  	_exit_internal(status); */
 /*  } */
 /*  } */
 
 
 /*  #endif */
 /*  #endif */

+ 3 - 1
libc/stdlib/system.c

@@ -1,6 +1,8 @@
 #define wait4 __wait4
 #define wait4 __wait4
 #define execl __execl
 #define execl __execl
 #define signal __signal
 #define signal __signal
+#define vfork __vfork
+#define fork __fork
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <stddef.h>
 #include <stddef.h>
@@ -38,7 +40,7 @@ int __libc_system(char *command)
 		signal(SIGCHLD, SIG_DFL);
 		signal(SIGCHLD, SIG_DFL);
 
 
 		execl("/bin/sh", "sh", "-c", command, (char *) 0);
 		execl("/bin/sh", "sh", "-c", command, (char *) 0);
-		_exit(127);
+		_exit_internal(127);
 	}
 	}
 	/* Signals are not absolutly guarenteed with vfork */
 	/* Signals are not absolutly guarenteed with vfork */
 	signal(SIGQUIT, SIG_IGN);
 	signal(SIGQUIT, SIG_IGN);

+ 5 - 3
libc/stdlib/unix_grantpt.c

@@ -24,6 +24,8 @@
 #define waitpid __waitpid
 #define waitpid __waitpid
 #define dup2 __dup2
 #define dup2 __dup2
 #define chmod __chmod
 #define chmod __chmod
+#define vfork __vfork
+#define fork __fork
 
 
 #include <assert.h>
 #include <assert.h>
 #include <errno.h>
 #include <errno.h>
@@ -42,7 +44,7 @@
 /* uClinux-2.0 has vfork, but Linux 2.0 doesn't */
 /* uClinux-2.0 has vfork, but Linux 2.0 doesn't */
 #include <sys/syscall.h>
 #include <sys/syscall.h>
 #if ! defined __NR_vfork
 #if ! defined __NR_vfork
-#define vfork fork	
+#define vfork fork
 #endif
 #endif
 
 
 extern int __ptsname_r (int fd, char *buf, size_t buflen) attribute_hidden;
 extern int __ptsname_r (int fd, char *buf, size_t buflen) attribute_hidden;
@@ -166,10 +168,10 @@ grantpt (int fd)
       /* We pase the master pseudo terminal as file descriptor PTY_FILENO.  */
       /* We pase the master pseudo terminal as file descriptor PTY_FILENO.  */
       if (fd != PTY_FILENO)
       if (fd != PTY_FILENO)
 	if (dup2 (fd, PTY_FILENO) < 0)
 	if (dup2 (fd, PTY_FILENO) < 0)
-	  _exit (FAIL_EBADF);
+	  _exit_internal (FAIL_EBADF);
 
 
       execle (_PATH_PT_CHOWN, _PATH_PT_CHOWN, NULL, NULL);
       execle (_PATH_PT_CHOWN, _PATH_PT_CHOWN, NULL, NULL);
-      _exit (FAIL_EXEC);
+      _exit_internal (FAIL_EXEC);
     }
     }
   else
   else
     {
     {

+ 4 - 3
libc/string/wstring.c

@@ -81,6 +81,7 @@ extern wchar_t *__wcspbrk (__const wchar_t *__wcs, __const wchar_t *__accept) at
 extern int __wcscmp (__const wchar_t *__s1, __const wchar_t *__s2) attribute_hidden;
 extern int __wcscmp (__const wchar_t *__s1, __const wchar_t *__s2) attribute_hidden;
 extern size_t __wcsxfrm (wchar_t *__restrict __s1,
 extern size_t __wcsxfrm (wchar_t *__restrict __s1,
 		       __const wchar_t *__restrict __s2, size_t __n) attribute_hidden;
 		       __const wchar_t *__restrict __s2, size_t __n) attribute_hidden;
+extern wint_t __towlower (wint_t __wc) __THROW attribute_hidden;
 #endif
 #endif
 #ifdef __UCLIBC_HAS_XLOCALE__
 #ifdef __UCLIBC_HAS_XLOCALE__
 extern int __strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) attribute_hidden;
 extern int __strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) attribute_hidden;
@@ -1263,7 +1264,7 @@ strong_alias(__ffs, ffs)
 #ifdef __UCLIBC_DO_XLOCALE
 #ifdef __UCLIBC_DO_XLOCALE
 #define TOLOWER(C) __towlower_l((C), locale_arg)
 #define TOLOWER(C) __towlower_l((C), locale_arg)
 #else
 #else
-#define TOLOWER(C) towlower((C))
+#define TOLOWER(C) __towlower((C))
 #endif
 #endif
 
 
 #else  /* defined(L_wcscasecmp) || defined(L_wcscasecmp_l) */
 #else  /* defined(L_wcscasecmp) || defined(L_wcscasecmp_l) */
@@ -1328,7 +1329,7 @@ __UCXL_ALIAS(strcasecmp)
 #ifdef __UCLIBC_DO_XLOCALE
 #ifdef __UCLIBC_DO_XLOCALE
 #define TOLOWER(C) __towlower_l((C), locale_arg)
 #define TOLOWER(C) __towlower_l((C), locale_arg)
 #else
 #else
-#define TOLOWER(C) towlower((C))
+#define TOLOWER(C) __towlower((C))
 #endif
 #endif
 
 
 #else  /* defined(L_wcsncasecmp) || defined(L_wcsncasecmp_l) */
 #else  /* defined(L_wcsncasecmp) || defined(L_wcsncasecmp_l) */
@@ -2113,7 +2114,7 @@ char attribute_hidden *__strsep(char ** __restrict s1, const char * __restrict s
 		*p++ = 0;
 		*p++ = 0;
 	}
 	}
 #else
 #else
-	if (s && *s && *(p = s + strcspn(s, s2))) {
+	if (s && *s && *(p = s + __strcspn(s, s2))) {
 		*p++ = 0;
 		*p++ = 0;
 	} else {
 	} else {
 		p = NULL;
 		p = NULL;

+ 1 - 0
libc/sysdeps/linux/arm/ioperm.c

@@ -37,6 +37,7 @@
 #define mmap __mmap
 #define mmap __mmap
 #define sscanf __sscanf
 #define sscanf __sscanf
 #define fscanf __fscanf
 #define fscanf __fscanf
+#define fgets __fgets
 
 
 #include <errno.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <fcntl.h>

+ 1 - 1
libc/sysdeps/linux/common/_exit.c

@@ -34,7 +34,7 @@ static inline _syscall1(void, __syscall_exit, int, status);
 
 
 #undef _exit
 #undef _exit
 #undef _exit_internal
 #undef _exit_internal
-void attribute_noreturn _exit_internal(int status)
+void attribute_noreturn attribute_hidden _exit_internal(int status)
 {
 {
 	/* The loop is added only to keep gcc happy. */
 	/* The loop is added only to keep gcc happy. */
 	while(1)
 	while(1)

+ 1 - 31
libc/sysdeps/linux/common/bits/uClibc_ctype.h

@@ -134,17 +134,6 @@ enum {
 #define __C_tolower(c) (__C_isupper(c) ? ((c) | 0x20) : (c))
 #define __C_tolower(c) (__C_isupper(c) ? ((c) | 0x20) : (c))
 #define __C_toupper(c) (__C_islower(c) ? ((c) ^ 0x20) : (c))
 #define __C_toupper(c) (__C_islower(c) ? ((c) ^ 0x20) : (c))
 
 
-#define __C_isxlower(c) \
-	(__C_isdigit(c) \
-	 || ((sizeof(c) == sizeof(char)) \
-		 ? (((unsigned char)(((c)) - 'a')) < 6) \
-		 : (((unsigned int)(((c)) - 'a')) < 6)))
-#define __C_isxupper(c) \
-	(__C_isdigit(c) \
-	 || ((sizeof(c) == sizeof(char)) \
-		 ? (((unsigned char)(((c)) - 'A')) < 6) \
-		 : (((unsigned int)(((c)) - 'A')) < 6)))
-
 /**********************************************************************/
 /**********************************************************************/
 __BEGIN_DECLS
 __BEGIN_DECLS
 
 
@@ -171,14 +160,7 @@ extern int isascii(int c) __THROW;
 extern int toascii(int c) __THROW;
 extern int toascii(int c) __THROW;
 #endif
 #endif
 
 
-/* The following are included for compatibility with older versions of
+#if defined _LIBC && (defined NOT_IN_libc || defined IS_IN_libc)
- * uClibc; but now they're only visible if MISC funcctionality is requested.
- * However, as they are locale-independent, the hidden macro versions are
- * always present. */
-#ifdef __USE_MISC
-extern int isxlower(int c) __THROW;	/* uClibc-specific. */
-extern int isxupper(int c) __THROW;	/* uClibc-specific. */
-
 /* isdigit() is really locale-invariant, so provide some small fast macros.
 /* isdigit() is really locale-invariant, so provide some small fast macros.
  * These are uClibc-specific. */
  * These are uClibc-specific. */
 #define __isdigit_char(C)    (((unsigned char)((C) - '0')) <= 9)
 #define __isdigit_char(C)    (((unsigned char)((C) - '0')) <= 9)
@@ -203,12 +185,6 @@ extern int isxupper(int c) __THROW;	/* uClibc-specific. */
 #define _tolower(c) ((c) | 0x20)
 #define _tolower(c) ((c) | 0x20)
 
 
 
 
-/* For compatibility with older versions of uClibc.  Are these ever used? */
-#if 0
-#define __isxlower(c)	__C_isxlower(c)	/* uClibc-specific. */
-#define __isxupper(c)	__C_isxupper(c)	/* uClibc-specific. */
-#endif
-
 /* Apparently, glibc implements things as macros if __NO_CTYPE isn't defined.
 /* Apparently, glibc implements things as macros if __NO_CTYPE isn't defined.
  * If we don't have locale support, we'll do the same.  Otherwise, we'll
  * If we don't have locale support, we'll do the same.  Otherwise, we'll
  * only use macros for the supported-locale-invariant cases. */
  * only use macros for the supported-locale-invariant cases. */
@@ -264,9 +240,6 @@ __END_DECLS
 #define __ispunct(c)		__body(ispunct,c)
 #define __ispunct(c)		__body(ispunct,c)
 #define __isgraph(c)		__body(isgraph,c)
 #define __isgraph(c)		__body(isgraph,c)
 
 
-#define __isxlower(c)		__body(isxlower,c)
-#define __isxupper(c)		__body(isxupper,c)
-
 #define __tolower(c)		__body(tolower,c)
 #define __tolower(c)		__body(tolower,c)
 #define __toupper(c)		__body(toupper,c)
 #define __toupper(c)		__body(toupper,c)
 
 
@@ -285,9 +258,6 @@ __END_DECLS
 #define ispunct(c)			__ispunct(c)
 #define ispunct(c)			__ispunct(c)
 #define isgraph(c)			__isgraph(c)
 #define isgraph(c)			__isgraph(c)
 
 
-#define isxlower(c)			__isxlower(c)
-#define isxupper(c)			__isxupper(c)
-
 #define tolower(c)			__tolower(c)
 #define tolower(c)			__tolower(c)
 #define toupper(c)			__toupper(c)
 #define toupper(c)			__toupper(c)
 
 

+ 2 - 1
libc/termios/ttyname.c

@@ -1,5 +1,6 @@
 #define opendir __opendir
 #define opendir __opendir
 #define closedir __closedir
 #define closedir __closedir
+#define readdir __readdir
 #define isatty __isatty
 #define isatty __isatty
 
 
 #include <string.h>
 #include <string.h>
@@ -73,7 +74,7 @@ int attribute_hidden __ttyname_r(int fd, char *ubuf, size_t ubuflen)
 			continue;
 			continue;
 		}
 		}
 
 
-		while ((d = __readdir(fp)) != NULL) {
+		while ((d = readdir(fp)) != NULL) {
 			/* This should never trigger for standard names, but we
 			/* This should never trigger for standard names, but we
 			 * check it to be safe.  */
 			 * check it to be safe.  */
 			if (__strlen(d->d_name) > len) { /* Too big? */
 			if (__strlen(d->d_name) > len) { /* Too big? */

+ 3 - 2
libc/unistd/daemon.c

@@ -26,6 +26,7 @@
 #define dup2 __dup2
 #define dup2 __dup2
 #define setsid __setsid
 #define setsid __setsid
 #define chdir __chdir
 #define chdir __chdir
+#define fork __fork
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <features.h>
 #include <features.h>
@@ -45,7 +46,7 @@ int daemon( int nochdir, int noclose )
 		case 0:
 		case 0:
 			break;
 			break;
 		default:
 		default:
-			_exit(0);
+			_exit_internal(0);
 	}
 	}
 
 
 	if (setsid() == -1)
 	if (setsid() == -1)
@@ -54,7 +55,7 @@ int daemon( int nochdir, int noclose )
 	/* Make certain we are not a session leader, or else we
 	/* Make certain we are not a session leader, or else we
 	 * might reacquire a controlling terminal */
 	 * might reacquire a controlling terminal */
 	if (fork())
 	if (fork())
-		_exit(0);
+		_exit_internal(0);
 
 
 	if (!nochdir)
 	if (!nochdir)
 		chdir("/");
 		chdir("/");

+ 5 - 1
libc/unistd/getpass.c

@@ -21,6 +21,8 @@
 #define tcgetattr __tcgetattr
 #define tcgetattr __tcgetattr
 #define fileno __fileno
 #define fileno __fileno
 #define fflush __fflush
 #define fflush __fflush
+#define fgets __fgets
+#define fputs __fputs
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <string.h>
 #include <string.h>
@@ -28,6 +30,8 @@
 #include <unistd.h>
 #include <unistd.h>
 #include <string.h>
 #include <string.h>
 
 
+extern int __putc(int c, FILE *stream) attribute_hidden;
+
 /* It is desirable to use this bit on systems that have it.
 /* It is desirable to use this bit on systems that have it.
    The only bit of terminal state we want to twiddle is echoing, which is
    The only bit of terminal state we want to twiddle is echoing, which is
    done in software; there is no need to change the state of the terminal
    done in software; there is no need to change the state of the terminal
@@ -95,7 +99,7 @@ getpass (prompt)
 	  buf[nread - 1] = '\0';
 	  buf[nread - 1] = '\0';
 	  if (tty_changed)
 	  if (tty_changed)
 	    /* Write the newline that was not echoed.  */
 	    /* Write the newline that was not echoed.  */
-	    putc('\n', out);
+	    __putc('\n', out);
 	}
 	}
     }
     }
 
 

+ 1 - 0
libc/unistd/usershell.c

@@ -32,6 +32,7 @@
 
 
 #define __fsetlocking __fsetlocking_internal
 #define __fsetlocking __fsetlocking_internal
 #define fileno __fileno
 #define fileno __fileno
+#define fgets_unlocked __fgets_unlocked
 
 
 #define _GNU_SOURCE
 #define _GNU_SOURCE
 #include <sys/param.h>
 #include <sys/param.h>