mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-15 21:44:36 +03:00
Embracing branches
This commit is contained in:
@ -61,8 +61,11 @@ void TraceScreen_delete(Object* cast) {
|
||||
kill(this->child, SIGTERM);
|
||||
waitpid(this->child, NULL, 0);
|
||||
}
|
||||
if (this->strace)
|
||||
|
||||
if (this->strace) {
|
||||
fclose(this->strace);
|
||||
}
|
||||
|
||||
CRT_enableDelay();
|
||||
free(InfoScreen_done((InfoScreen*)this));
|
||||
}
|
||||
@ -144,9 +147,11 @@ void TraceScreen_updateTrace(InfoScreen* super) {
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 500;
|
||||
int ready = select(fd_strace + 1, &fds, NULL, NULL, &tv);
|
||||
|
||||
size_t nread = 0;
|
||||
if (ready > 0 && FD_ISSET(fd_strace, &fds))
|
||||
nread = fread(buffer, 1, sizeof(buffer) - 1, this->strace);
|
||||
|
||||
if (nread && this->tracing) {
|
||||
const char* line = buffer;
|
||||
buffer[nread] = '\0';
|
||||
@ -167,8 +172,9 @@ void TraceScreen_updateTrace(InfoScreen* super) {
|
||||
buffer[nread] = '\0';
|
||||
this->contLine = true;
|
||||
}
|
||||
if (this->follow)
|
||||
Panel_setSelected(this->super.display, Panel_size(this->super.display)-1);
|
||||
if (this->follow) {
|
||||
Panel_setSelected(this->super.display, Panel_size(this->super.display) - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user