summaryrefslogtreecommitdiffstats
path: root/plugins/t
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/t')
0 files changed, 0 insertions, 0 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index 10d544c..da9cced 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -60,8 +60,8 @@ char *strpcat (char *dest, const char *src, const char *str);
60#define max(a,b) ((a)>(b))?(a):(b) 60#define max(a,b) ((a)>(b))?(a):(b)
61 61
62/* ************************************************************************** 62/* **************************************************************************
63 * max_state(result, STATE_x) 63 * max_state(STATE_x, STATE_y)
64 * compares STATE_x to result and returns result if STATE_x is less than a based on the following 64 * compares STATE_x to STATE_y and returns result based on the following
65 * STATE_UNKNOWN < STATE_OK < STATE_WARNING < STATE_CRITICAL 65 * STATE_UNKNOWN < STATE_OK < STATE_WARNING < STATE_CRITICAL
66 * 66 *
67 * Note that numerically the above does not hold 67 * Note that numerically the above does not hold
@@ -70,31 +70,18 @@ char *strpcat (char *dest, const char *src, const char *str);
70int 70int
71max_state(int a, int b) 71max_state(int a, int b)
72{ 72{
73 if(a == STATE_CRITICAL){ 73 if (a == STATE_CRITICAL || b == STATE_CRITICAL)
74 return a; 74 return STATE_CRITICAL;
75 } 75 else if (a == STATE_WARNING || b == STATE_WARNING)
76 else if (a == STATE_WARNING) { 76 return STATE_WARNING;
77 77 else if (a == STATE_OK || b == STATE_OK)
78 if (b == STATE_CRITICAL){ 78 return STATE_OK;
79 return b; 79 else if (a == STATE_UNKNOWN || b == STATE_UNKNOWN)
80 }else { 80 return STATE_UNKNOWN;
81 return a; 81 else if (a == STATE_DEPENDENT || b == STATE_DEPENDENT)
82 } 82 return STATE_DEPENDENT;
83 } 83 else
84 else if (a == STATE_OK) { 84 return max (a, b);
85
86 if ( b== STATE_CRITICAL || b == STATE_WARNING) {
87 return b;
88 }else{
89 return a;
90 }
91 }
92 else {
93 /* a == UNKNOWN */
94 return b;
95 }
96
97
98} 85}
99 86
100char * 87char *