summaryrefslogtreecommitdiffstats
path: root/TraceScreen.c
Commit message (Collapse)AuthorAgeFilesLines
* Use 'fp' name for local 'FILE*' variables.Explorer0912 days1-3/+3
| | | | | | | | | | | It is inappropriate to use the 'fd' name for 'FILE*' variables. POSIX file descriptiors are of type 'int' and are distinguished from ISO C stream pointers (type 'FILE*'). Rename these variables to 'fp', which is a preferred naming in POSIX. (Note that ISO C preferred the 'stream' name for the variables.) No code changes.
* Fix execlp() argument without pointer castExplorer092023-12-291-1/+2
| | | | Regression from c55401b82b1bb278947f9d2a3aed13a9f0de85a9
* Add support for "truss" (FreeBSD equivalent of "strace")Daniel (dmilith) Dettlaff2023-12-291-6/+17
|
* Fix code styleBenny Baumann2023-12-261-0/+2
|
* Introduce Row and Table classes for screens beyond top-processesNathan Scott2023-08-301-2/+2
| | | | | | | | | This commit refactors the Process and ProcessList structures such they each have a new parent - Row and Table, respectively. These new classes handle screen updates relating to anything that could be represented in tabular format, e.g. cgroups, filesystems, etc, without us having to reimplement the display logic repeatedly for each new entity.
* Minor code formatting consistency fixesBenny Baumann2023-04-111-1/+1
|
* Reformat code baseBenny Baumann2022-10-241-3/+3
| | | | | | | | | | | | | | This includes: - Wrap function implementations - Pointer alignment for function signatures - Pointer alignment for variable declarations - Whitespace after keywords - Whitespace after comma - Whitespace around initializers - Whitespace around operators - Code indentation - Line break for single line statements - Misleading alignment
* Use of NULL in execlp() must have a pointer cast.Explorer092022-05-191-1/+3
| | | | Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
* Avoid zombie processes on signal racesTobias Stoeckmann2022-01-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The system curses library can handle terminal size changes with SIGWINCH without asking system calls to restart, which effectively stops system calls with -1 and EINTR. An example is ncurses on Linux systems. One of these system calls is waitpid. While waiting for the lsof child to complete, a badly timed SIGWINCH can interrupt the waitpid call, effectively never clearing the state of the child, keeping the zombie until htop exits. Proof of Concept: #include <unistd.h> int main(void) { close(1); close(2); sleep(5); return 0; } Compile this as a replacement "lsof" and put it into your path. Make sure that it's called instead of the real lsof. Press "l" to list open files and resize your terminal within the next 5 seconds. You will see that a zombie process is kept by htop when the timeout finishes.
* Update license headers to explicitly say GPLv2+Daniel Lange2021-09-221-1/+1
|
* IWYU updateChristian Göttsche2021-08-251-1/+0
|
* cleaned up includes with iwyumayurdahibhate2021-05-101-1/+0
|
* Use ATTR_UNUSED instead of void castingChristian Göttsche2021-03-021-2/+1
|
* Refactor to remove no-op callsBenny Baumann2021-02-171-2/+0
| | | | This removes the call-sites of the removed setuid feature
* TraceScreen: draw panel headerYoungjae Lee2021-01-281-1/+1
|
* Mark several non-modified pointer variables constChristian Göttsche2021-01-111-1/+1
|
* Merge branch 'misc' of https://github.com/cgzones/htop into cgzones-miscChristian Göttsche2020-12-221-13/+13
|\
| * TraceScreen: mark local class functions staticChristian Göttsche2020-12-211-13/+13
| |
* | Rework drawing of FunctionBarChristian Göttsche2020-12-201-5/+1
|/ | | | | | | | | | | Draw the FunctionBar within Panel_draw instead of manually throughout the code. Add an optional PanelClass function drawFunctionBar, to allow specific panels to override the default FunctionBar_draw call. Rework the code on color change, to really change all colors (selection markers and panel headers). Closes: #402
* Mark event arrays constChristian Göttsche2020-12-201-1/+1
|
* Improving Command display/sortNarendran Gopalakrishnan2020-11-241-1/+1
|
* Shorten initializerBenny Baumann2020-11-021-3/+1
|
* Embracing branchesBenny Baumann2020-11-021-3/+9
|
* Spacing around operatorsBenny Baumann2020-11-021-5/+6
|
* Spacing after keywords (if)Benny Baumann2020-11-021-2/+2
|
* Make all required includes explicitBenny Baumann2020-10-181-13/+15
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* Ensure full initialization of all fieldsBenny Baumann2020-10-181-3/+2
|
* Fix various file descriptor leaksBenny Baumann2020-10-181-23/+56
|
* Rename StringUtils.[ch] to XUtils.[ch]Benny Baumann2020-10-161-1/+1
|
* Misc conversion fixesChristian Göttsche2020-10-161-3/+3
|
* Mark Object instances constChristian Göttsche2020-10-071-1/+1
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Avoid hardcoding of buffer sizeBenny Baumann2020-09-171-2/+2
|
* Barely ever seen any 1000 digit PIDs …Benny Baumann2020-09-171-1/+1
|
* Clean up some code duplication in the header filesHugo Musso Gualandi2020-09-121-1/+0
| | | | | | | | | | | | | PR htop-dev/htop#70 got rid of the infrastructure for generating header files, but it left behind some code duplication. Some of cases are things that belong in the header file and don't need to be repeated in the C file. Other cases are things that belong in the C file and don't need to be in the header file. In this commit I tried to fix all of these that I could find. When given a choice I preferred keeping things out of the header file, unless they were being used by someone else.
* Axe automated header generation.Zev Weiss2020-09-031-15/+0
| | | | | | | | | | | | | | Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
* Add timestamps to the strace screenMario Harjac2019-04-291-1/+1
|
* strace: increase string lengthHisham Muhammad2018-03-251-1/+1
|
* Replace size_t with int/void* unionHisham Muhammad2018-02-181-1/+2
| | | | | | | | I was occasionally passing negative values to size_t. Plus, this better reflects the intent of the variant argument. Reported by Coverity: https://scan8.coverity.com/reports.htm#v13253/p10402/fileInstanceId=22093891&defectInstanceId=7543346&mergedDefectId=174179&fileStart=251&fileEnd=500
* Security review: check results of snprintf.Hisham Muhammad2017-07-271-3/+3
| | | | | Calls marked with xSnprintf shouldn't fail. Abort program cleanly if any of them does.
* Merge branch 'master' of https://github.com/hishamhm/htopHisham Muhammad2017-07-261-2/+2
|\
| * Mark some things as constRichard2017-07-221-2/+2
| | | | | | | | | | | | | | Several string pointer arrays pointed to const strings but were not const themselves. A few various structures and arrays were also marked const.
* | Security review: make privilege dropping-restoring optional.Hisham Muhammad2017-07-261-1/+1
|/ | | | | | | This is/was necessary only on macOS, because you needed root in order to read the process list. This was never necessary on Linux, and it also raises security concerns, so now it needs to be enabled explicitly at build time.
* Add missing includecoypoop2017-03-251-0/+1
| | | sys/time.h for struct timeval
* Replace all uses of sprintf with snprintfTomasz Kramkowski2016-12-291-1/+1
| | | | | | | | | | | | In all the cases where sprintf was being used within htop, snprintf could have been used. This patch replaces all uses of sprintf with snprintf which makes sure that if a buffer is too small to hold the resulting string, the string is simply cut short instead of causing a buffer overflow which leads to undefined behaviour. `sizeof(variable)` was used in these cases, as opposed to `sizeof variable` which is my personal preference because `sizeof(variable)` was already used in one way or another in other parts of the code.
* Silence warnings about seteuid return value.Hisham2016-05-251-1/+1
| | | | Closes #483.
* Check for failure in allocations.Hisham2016-02-021-1/+1
|
* refactor *Screen classes, add InfoScreen superclassHisham Muhammad2016-01-121-156/+98
|
* add some security checks when running SUID rootMichael Klein2015-12-021-0/+1
| | | | | | on Darwin, htop needs to run with root privileges to display information about other users processes. This commit makes running htop SUID root a bit more safe.
* Clean up some needless malloc casts, convert some mallocs to callocs, and ↵Michael McConville2015-09-161-1/+1
| | | | fix some style

© 2014-2024 Faster IT GmbH | imprint | privacy policy