summaryrefslogtreecommitdiffstats
path: root/patches/procps-3.2.8/45_proc_complain_unmounted_proc.dpatch
blob: c34e618b4a5d67edf5d0fa8753debbdd15de3c23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/sh /usr/share/dpatch/dpatch-run
## 45_proc_complain_unmounted_proc.dpatch by  <hesso@hesso.pool.math.tu-berlin.de>
##
## DP: Complain when /proc/version cannot be found instead of
## DP: exiting silently.

@DPATCH@
--- procps-3.2.7/proc/version.cO	2007-08-06 16:18:41.000000000 +0200
+++ procps-3.2.7/proc/version.c	2007-08-06 16:19:28.000000000 +0200
@@ -39,8 +39,10 @@
     FILE *fp;
     char buf[256];
     
-    if ( (fp=fopen("/proc/version","r")) == NULL) /* failure implies impending death */
+    if ( (fp=fopen("/proc/version","r")) == NULL) {
+      fprintf(stderr, "Cannot find /proc/version - is /proc mounted?\n");
       exit(1);
+    }
     if (fgets(buf, 256, fp) == NULL) {
       fprintf(stderr, "Cannot read kernel version from /proc/version\n");
       fclose(fp);