23 lines
886 B
Diff
23 lines
886 B
Diff
Ripped from Fedora
|
|
|
|
If /proc isnt mounted, `top` will cause screen corruption ...
|
|
|
|
--- top.c~
|
|
+++ top.c
|
|
@@ -3201,12 +3201,15 @@
|
|
|
|
int main (int dont_care_argc, char *argv[])
|
|
{
|
|
+ struct stat isproc;
|
|
(void)dont_care_argc;
|
|
before(*argv);
|
|
// +-------------+
|
|
windows_stage1(); // top (sic) slice
|
|
configs_read(); // > spread etc, <
|
|
parse_args(&argv[1]); // > lean stuff, <
|
|
+ if (stat("/proc/self", &isproc)==-1)
|
|
+ std_err("/proc is not mounted, required for output data");
|
|
whack_terminal(); // > onions etc. <
|
|
windows_stage2(); // as bottom slice
|
|
// +-------------+
|