File: 45_vmstat_exitcode.dpatch

package info (click to toggle)
procps 1%3A3.2.7-11
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,620 kB
  • ctags: 1,764
  • sloc: ansic: 14,645; sh: 5,299; makefile: 216
file content (26 lines) | stat: -rw-r--r-- 802 bytes parent folder | download
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);
   } 
 }