FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Laptop

 
 
LinkBack Thread Tools
 
Old 04-06-2011, 08:10 PM
Chris Lumens
 
Default Remove the duplicate backtrace setup code in init.c.

---
loader/init.c | 55 -------------------------------------------------------
1 files changed, 0 insertions(+), 55 deletions(-)

diff --git a/loader/init.c b/loader/init.c
index bdcf614..53d46a0 100644
--- a/loader/init.c
+++ b/loader/init.c
@@ -76,7 +76,6 @@ static int getSyslog(gchar **, gchar **);
static int onQEMU(void);
struct termios ts;

-static int expected_exit = 0;
static GHashTable *cmdline = NULL;

static void printstr(char * string) {
@@ -300,57 +299,6 @@ static void copyErrorFn (char *msg) {
printf(msg);
}

-void initSegvHandler(int signum) {
- void *array[30];
- size_t i;
- const char const * const errmsgs[] = {
- "init received SIG",
- "! Backtrace:
",
- "init exited unexpectedly! Backtrace:
",
- };
-
- /* XXX This should really be in a glibc header somewhere... */
- extern const char *const sys_sigabbrev[NSIG];
-
- signal(signum, SIG_DFL); /* back to default */
-
- if (signum == 0) {
- i = write(STDERR_FILENO, errmsgs[2], strlen(errmsgs[2]));
- } else {
- i = write(STDERR_FILENO, errmsgs[0], strlen(errmsgs[0]));
- i = write(STDERR_FILENO, sys_sigabbrev[signum],
- strlen(sys_sigabbrev[signum]));
- i = write(STDERR_FILENO, errmsgs[1], strlen(errmsgs[1]));
- }
-
- i = backtrace (array, 30);
- backtrace_symbols_fd(array, i, STDERR_FILENO);
- _exit(1);
-}
-
-void initExitHandler(void)
-{
- if (expected_exit)
- return;
-
- initSegvHandler(0);
-}
-
-static void setupBacktrace(void)
-{
- void *array;
-
- signal(SIGSEGV, initSegvHandler);
- signal(SIGABRT, initSegvHandler);
- atexit(initExitHandler);
-
- /* Turns out, there's an initializer at the top of backtrace() that
- * (on some arches) calls dlopen(). dlopen(), unsurprisingly, calls
- * malloc(). So, call backtrace() early in signal handler setup so
- * we can later safely call it from the signal handler itself. */
- backtrace(&array, 1);
-}
-
static char *setupMallocPerturb(char *value)
{
FILE *f;
@@ -435,9 +383,6 @@ int main(int argc, char **argv) {

umask(022);

- /* set up signal handler */
- setupBacktrace();
-
/* set up any environment variables that aren't totally static */
setupEnv();

--
1.7.4.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 06:17 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org