summaryrefslogtreecommitdiffstats
path: root/patches/procps-3.2.7/generic/10_top_no_openproc.dpatch
blob: 46d7087982b9b4804d5037576b48c3800aa8a4b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh /usr/share/dpatch/dpatch-run
## 10_top_no_openproc.dpatch by  <csmall@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Exit top if cannot openproc #378695

@DPATCH@
diff -urNad procps-3.2.7~/top.c procps-3.2.7/top.c
--- procps-3.2.7~/top.c	2009-01-09 17:04:25.000000000 +1100
+++ procps-3.2.7/top.c	2009-01-09 17:43:06.000000000 +1100
@@ -1097,6 +1097,12 @@
    else
       PT = openproc(flags);
 
+    if (PT==NULL) {
+        std_err(strerror(errno));
+        exit(1);
+    }
+
+
    // i) Allocated Chunks:  *Existing* table;  refresh + reuse
    if (!(CHKw(Curwin, Show_THREADS))) {
       while (curmax < savmax) {