simplify
This commit is contained in:
@@ -162,7 +162,6 @@ void BacktraceNames::FromString( CString s )
|
|||||||
void BacktraceNames::FromAddr( const void *p )
|
void BacktraceNames::FromAddr( const void *p )
|
||||||
{
|
{
|
||||||
int fds[2];
|
int fds[2];
|
||||||
int out = fileno(stdout);
|
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
pid_t ppid = getpid(); /* Do this before fork()ing! */
|
pid_t ppid = getpid(); /* Do this before fork()ing! */
|
||||||
|
|
||||||
@@ -188,7 +187,7 @@ void BacktraceNames::FromAddr( const void *p )
|
|||||||
for (int fd = 3; fd < 1024; ++fd)
|
for (int fd = 3; fd < 1024; ++fd)
|
||||||
if (fd != fds[1])
|
if (fd != fds[1])
|
||||||
close(fd);
|
close(fd);
|
||||||
dup2(fds[1], out);
|
dup2(fds[1], fileno(stdout));
|
||||||
close(fds[1]);
|
close(fds[1]);
|
||||||
|
|
||||||
char *addy;
|
char *addy;
|
||||||
@@ -201,7 +200,6 @@ void BacktraceNames::FromAddr( const void *p )
|
|||||||
fprintf(stderr, "execl(atos) failed: %s\n", strerror(errno));
|
fprintf(stderr, "execl(atos) failed: %s\n", strerror(errno));
|
||||||
free(addy);
|
free(addy);
|
||||||
free(p);
|
free(p);
|
||||||
close(out);
|
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user