summaryrefslogtreecommitdiffstats
path: root/patches/procps-3.2.7/generic/45_vmstat_exitcode.dpatch
blob: 4503d3951eb8a6a018a3b1dcefbd05b9920c5b0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/sh /usr/share/dpatch/dpatch-run
## 45_vmstat_exitcode.dpatch by  <gnufreedom100@gmail.com>
##
## DP: Make vmstat exit with return code of non-zero if there is a problem
@DPATCH@
diff -ur procps-3.2.7/vmstat.c procps-FIX/vmstat.c
--- procps-3.2.7/vmstat.c	2006-06-24 23:41:48.000000000 -0700
+++ procps-FIX/vmstat.c	2007-05-21 19:48:47.000000000 -0700
@@ -290,7 +290,7 @@
     fDiskstat=fopen("/proc/diskstats","rb");
     if(!fDiskstat){
         fprintf(stderr, "Your kernel doesn't support diskstat. (2.5.70 or above required)\n"); 
-        exit(0);
+        exit(EXIT_FAILURE);
     }
 
     fclose(fDiskstat);
@@ -400,7 +400,7 @@
     }
   }else{
     fprintf(stderr, "Your kernel doesn't support diskstat (2.5.70 or above required)\n"); 
-    exit(0);
+    exit(EXIT_FAILURE);
   } 
 }