summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-18 16:33:39 +0200
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-18 16:33:39 +0200
commit58123356d562a29345b1145ec3cd78e7f458fb00 (patch)
tree04fb29b6446f7d09b9919a74c99289b1e26e3416 /plugins
parent7ef12f5510bc72bbb010f7c7cd2581ac0d8f0845 (diff)
downloadmonitoring-plugins-58123356d562a29345b1145ec3cd78e7f458fb00.tar.gz
check_ide_smart: Use C99 booleans
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_ide_smart.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c
index 0160d98b..3872e341 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 *);
169int nagios (values_t *, thresholds_t *); 165int nagios (values_t *, thresholds_t *);
170void print_value (value_t *, threshold_t *); 166void print_value (value_t *, threshold_t *);
171void print_values (values_t *, thresholds_t *); 167void print_values (values_t *, thresholds_t *);
172int smart_cmd_simple (int, enum SmartCommand, __u8, char); 168int smart_cmd_simple (int, enum SmartCommand, __u8, bool);
173int smart_read_thresholds (int, thresholds_t *); 169int smart_read_thresholds (int, thresholds_t *);
174int verbose = FALSE; 170bool verbose = false;
175 171
176int 172int
177main (int argc, char *argv[]) 173main (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
450int 446int smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, bool show_error) {
451smart_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];