diff options
Diffstat (limited to 'plugins/check_ide_smart.c')
-rw-r--r-- | plugins/check_ide_smart.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c index 0160d98..3872e34 100644 --- a/plugins/check_ide_smart.c +++ b/plugins/check_ide_smart.c | |||
@@ -73,10 +73,6 @@ void print_usage (void); | |||
73 | 73 | ||
74 | #define NR_ATTRIBUTES 30 | 74 | #define NR_ATTRIBUTES 30 |
75 | 75 | ||
76 | #ifndef TRUE | ||
77 | #define TRUE 1 | ||
78 | #endif /* */ | ||
79 | |||
80 | #define PREFAILURE 2 | 76 | #define PREFAILURE 2 |
81 | #define ADVISORY 1 | 77 | #define ADVISORY 1 |
82 | #define OPERATIONAL 0 | 78 | #define OPERATIONAL 0 |
@@ -169,9 +165,9 @@ int smart_read_values (int, values_t *); | |||
169 | int nagios (values_t *, thresholds_t *); | 165 | int nagios (values_t *, thresholds_t *); |
170 | void print_value (value_t *, threshold_t *); | 166 | void print_value (value_t *, threshold_t *); |
171 | void print_values (values_t *, thresholds_t *); | 167 | void print_values (values_t *, thresholds_t *); |
172 | int smart_cmd_simple (int, enum SmartCommand, __u8, char); | 168 | int smart_cmd_simple (int, enum SmartCommand, __u8, bool); |
173 | int smart_read_thresholds (int, thresholds_t *); | 169 | int smart_read_thresholds (int, thresholds_t *); |
174 | int verbose = FALSE; | 170 | bool verbose = false; |
175 | 171 | ||
176 | int | 172 | int |
177 | main (int argc, char *argv[]) | 173 | main (int argc, char *argv[]) |
@@ -203,7 +199,7 @@ main (int argc, char *argv[]) | |||
203 | bindtextdomain (PACKAGE, LOCALEDIR); | 199 | bindtextdomain (PACKAGE, LOCALEDIR); |
204 | textdomain (PACKAGE); | 200 | textdomain (PACKAGE); |
205 | 201 | ||
206 | while (1) { | 202 | while (true) { |
207 | 203 | ||
208 | o = getopt_long (argc, argv, "+d:iq10nhVv", longopts, &longindex); | 204 | o = getopt_long (argc, argv, "+d:iq10nhVv", longopts, &longindex); |
209 | 205 | ||
@@ -229,7 +225,7 @@ main (int argc, char *argv[]) | |||
229 | fprintf (stderr, "%s\n", _("default and will be removed from future releases.")); | 225 | fprintf (stderr, "%s\n", _("default and will be removed from future releases.")); |
230 | break; | 226 | break; |
231 | case 'v': /* verbose */ | 227 | case 'v': /* verbose */ |
232 | verbose = TRUE; | 228 | verbose = true; |
233 | break; | 229 | break; |
234 | case 'h': | 230 | case 'h': |
235 | print_help (); | 231 | print_help (); |
@@ -258,7 +254,7 @@ main (int argc, char *argv[]) | |||
258 | return STATE_CRITICAL; | 254 | return STATE_CRITICAL; |
259 | } | 255 | } |
260 | 256 | ||
261 | if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, FALSE)) { | 257 | if (smart_cmd_simple (fd, SMART_CMD_ENABLE, 0, false)) { |
262 | printf (_("CRITICAL - SMART_CMD_ENABLE\n")); | 258 | printf (_("CRITICAL - SMART_CMD_ENABLE\n")); |
263 | return STATE_CRITICAL; | 259 | return STATE_CRITICAL; |
264 | } | 260 | } |
@@ -447,9 +443,7 @@ print_values (values_t * p, thresholds_t * t) | |||
447 | } | 443 | } |
448 | 444 | ||
449 | 445 | ||
450 | int | 446 | int smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, bool show_error) { |
451 | smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error) | ||
452 | { | ||
453 | int e = STATE_UNKNOWN; | 447 | int e = STATE_UNKNOWN; |
454 | #ifdef __linux__ | 448 | #ifdef __linux__ |
455 | __u8 args[4]; | 449 | __u8 args[4]; |