vp-build/srcpkgs/procps/patches/complain_unmounted_proc.patch

20 lines
771 B
Diff

Author: <hesso@hesso.pool.math.tu-berlin.de>
Description: Complain when /proc/version cannot be found instead of
exiting silently.
Index: b/proc/version.c
===================================================================
--- a/proc/version.c 2009-11-24 21:00:44.000000000 +1100
+++ b/proc/version.c 2009-11-24 21:00:46.000000000 +1100
@@ -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);