diff options
| -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) { |
