summaryrefslogtreecommitdiff
path: root/core/procps-ng/complain_unmounted_proc.patch
blob: ed932dbba23a7057839e89f0b6fe4b6d406e9464 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Author: <hesso@hesso.pool.math.tu-berlin.de>
Description: Complain when /proc/version cannot be found instead of
exiting silently.
--- a/proc/version.c
+++ b/proc/version.c
@@ -33,8 +33,10 @@
     char buf[256];
     int version_string_depth;
     
-    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);