blob: f581cf459c82107b1c0d1686cf841f92a328cb65 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
Ripped from Fedora
If /proc isnt mounted, `top` will cause screen corruption ...
--- procps-3.2.3/top.c
+++ procps-3.2.3/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
// +-------------+
|