diff options
Diffstat (limited to 'TraceScreen.c')
-rw-r--r-- | TraceScreen.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/TraceScreen.c b/TraceScreen.c index da98e02..93981c5 100644 --- a/TraceScreen.c +++ b/TraceScreen.c @@ -18,12 +18,10 @@ in the source distribution for its full text. #include <string.h> #include <unistd.h> #include <sys/select.h> -#include <sys/time.h> #include <sys/wait.h> #include "CRT.h" #include "FunctionBar.h" -#include "IncSet.h" #include "Panel.h" #include "ProvideCurses.h" #include "XUtils.h" @@ -35,14 +33,14 @@ static const char* const TraceScreenKeys[] = {"F3", "F4", "F8", "F9", "Esc"}; static const int TraceScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(8), KEY_F(9), 27}; -TraceScreen* TraceScreen_new(Process* process) { +TraceScreen* TraceScreen_new(const Process* process) { // This initializes all TraceScreen variables to "false" so only default = true ones need to be set below TraceScreen* this = xCalloc(1, sizeof(TraceScreen)); Object_setClass(this, Class(TraceScreen)); this->tracing = true; FunctionBar* fuBar = FunctionBar_new(TraceScreenFunctions, TraceScreenKeys, TraceScreenEvents); CRT_disableDelay(); - return (TraceScreen*) InfoScreen_init(&this->super, process, fuBar, LINES - 2, ""); + return (TraceScreen*) InfoScreen_init(&this->super, process, fuBar, LINES - 2, " "); } void TraceScreen_delete(Object* cast) { @@ -87,16 +85,13 @@ bool TraceScreen_forkTracer(TraceScreen* this) { dup2(fdpair[1], STDERR_FILENO); close(fdpair[1]); - CRT_dropPrivileges(); - char buffer[32] = {0}; xSnprintf(buffer, sizeof(buffer), "%d", this->super.process->pid); execlp("strace", "strace", "-T", "-tt", "-s", "512", "-p", buffer, NULL); // Should never reach here, unless execlp fails ... const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH."; - ssize_t written = write(STDERR_FILENO, message, strlen(message)); - (void) written; + (void)! write(STDERR_FILENO, message, strlen(message)); exit(127); } |