diff options
| author | Khem Raj <kraj@mvista.com> | 2009-04-14 19:20:51 +0000 |
|---|---|---|
| committer | Khem Raj <kraj@mvista.com> | 2009-04-14 19:20:51 +0000 |
| commit | a4674e039e70de4d1c6285fc79383aad014cf1c2 (patch) | |
| tree | 077ab511a2b707b0061e5a1a7fabbc1384c25ed5 | |
| parent | 1507c79c68e0e6c390f9a82642cd548ed8556ce3 (diff) | |
| download | uClibc-alpine-a4674e039e70de4d1c6285fc79383aad014cf1c2.tar.bz2 uClibc-alpine-a4674e039e70de4d1c6285fc79383aad014cf1c2.tar.xz | |
Merged revisions 26046,26062,26066,26078 via svnmerge from
svn+ssh://kraj@svn.uclibc.org/svn/trunk/uClibc
........
r26046 | aldot | 2009-04-09 10:48:17 -0700 (Thu, 09 Apr 2009) | 2 lines
- fix typo
........
r26062 | austinf | 2009-04-10 17:08:47 -0700 (Fri, 10 Apr 2009) | 4 lines
sparc also needs CONSTANT_STRING_GOT_FIXUP for doing debug printing in ldso
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
........
r26066 | austinf | 2009-04-11 12:30:04 -0700 (Sat, 11 Apr 2009) | 5 lines
for sparc v8 MAGIC1 was defined incorrectly
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
........
r26078 | vapier | 2009-04-12 17:06:40 -0700 (Sun, 12 Apr 2009) | 1 line
make sure to block all signals when calling daemon() to prevent delivery while the parent is sharing the stack
........
| -rw-r--r-- | Makefile.help | 2 | ||||
| -rw-r--r-- | ldso/include/dl-string.h | 2 | ||||
| -rw-r--r-- | ldso/ldso/sparc/dl-sysdep.h | 2 | ||||
| -rw-r--r-- | libc/unistd/daemon.c | 14 |
4 files changed, 16 insertions, 4 deletions
diff --git a/Makefile.help b/Makefile.help index a2087164b..3a8432870 100644 --- a/Makefile.help +++ b/Makefile.help @@ -8,7 +8,7 @@ help: @echo 'Cleaning:' @echo ' clean - delete temporary object files' - @echo ' realclean - delete temporary object file, including dependencies' + @echo ' realclean - delete temporary object files, including dependencies' @echo ' distclean - delete all non-source files (including .config)' @echo @echo 'Build:' diff --git a/ldso/include/dl-string.h b/ldso/include/dl-string.h index 1a47e31ed..01ab50ec9 100644 --- a/ldso/include/dl-string.h +++ b/ldso/include/dl-string.h @@ -286,7 +286,7 @@ static __always_inline char * _dl_simple_ltoahex(char *local, unsigned long i) * This requires that load_addr must already be defined... */ #if defined(mc68000) || defined(__arm__) || defined(__thumb__) || \ defined(__mips__) || defined(__sh__) || defined(__powerpc__) || \ - defined(__avr32__) || defined(__xtensa__) + defined(__avr32__) || defined(__xtensa__) || defined(__sparc__) # define CONSTANT_STRING_GOT_FIXUP(X) \ if ((X) < (const char *) load_addr) (X) += load_addr # define NO_EARLY_SEND_STDERR diff --git a/ldso/ldso/sparc/dl-sysdep.h b/ldso/ldso/sparc/dl-sysdep.h index 03f469f4e..d35a39147 100644 --- a/ldso/ldso/sparc/dl-sysdep.h +++ b/ldso/ldso/sparc/dl-sysdep.h @@ -29,7 +29,7 @@ /* Here we define the magic numbers that this dynamic loader should accept * Note that SPARCV9 doesn't use EM_SPARCV9 since the userland is still 32-bit. */ -#if defined(__sparc_v9__) || defined(__sparc_v8__) +#if defined(__sparc_v9__) #define MAGIC1 EM_SPARC32PLUS #else #define MAGIC1 EM_SPARC diff --git a/libc/unistd/daemon.c b/libc/unistd/daemon.c index 0e439d1ba..6543f1c11 100644 --- a/libc/unistd/daemon.c +++ b/libc/unistd/daemon.c @@ -44,6 +44,7 @@ #include <features.h> #include <fcntl.h> #include <paths.h> +#include <signal.h> #include <unistd.h> #ifdef __UCLIBC_HAS_THREADS_NATIVE__ #include <errno.h> @@ -66,7 +67,7 @@ /* use clone() to get fork() like behavior here -- we just want to disassociate * from the controlling terminal */ -static inline pid_t fork_parent(void) +static inline pid_t _fork_parent(void) { register unsigned long ret = INTERNAL_SYSCALL(clone, wtf, 2, CLONE_VM, 0); if (ret != -1 && ret != 0) @@ -74,6 +75,17 @@ static inline pid_t fork_parent(void) INTERNAL_SYSCALL(exit, wtf, 0); return ret; } +static inline pid_t fork_parent(void) +{ + /* Block all signals to keep the parent from using the stack */ + pid_t ret; + sigset_t new_set, old_set; + sigfillset(&new_set); + sigprocmask(SIG_BLOCK, &new_set, &old_set); + ret = _fork_parent(); + sigprocmask(SIG_SETMASK, &old_set, NULL); + return ret; +} #else static inline pid_t fork_parent(void) { |
