summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-18 17:25:56 +0200
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-10-18 17:26:43 +0200
commit9274b6db8b4c60d50fc65187cb794fd144dbc9e1 (patch)
treeb093278dcd5753f4c93c5a8fdc5d2eb2a9337f4b /plugins
parente3cc83f6ae6587ecf77b3384a16eb0f70f3cc4b1 (diff)
downloadmonitoring-plugins-9274b6db8b4c60d50fc65187cb794fd144dbc9e1.tar.gz
check_pgsql: Use C99 booleans
Diffstat (limited to 'plugins')
-rw-r--r--plugins/check_pgsql.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 61990335..94d589e1 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -69,7 +69,7 @@ int process_arguments (int, char **);
69int validate_arguments (void); 69int validate_arguments (void);
70void print_usage (void); 70void print_usage (void);
71void print_help (void); 71void print_help (void);
72int is_pg_logname (char *); 72bool is_pg_logname (char *);
73int do_query (PGconn *, char *); 73int do_query (PGconn *, char *);
74 74
75char *pghost = NULL; /* host name of the backend server */ 75char *pghost = NULL; /* host name of the backend server */
@@ -252,7 +252,7 @@ main (int argc, char **argv)
252 printf (_(" %s - database %s (%f sec.)|%s\n"), 252 printf (_(" %s - database %s (%f sec.)|%s\n"),
253 state_text(status), dbName, elapsed_time, 253 state_text(status), dbName, elapsed_time,
254 fperfdata("time", elapsed_time, "s", 254 fperfdata("time", elapsed_time, "s",
255 !!(twarn > 0.0), twarn, !!(tcrit > 0.0), tcrit, TRUE, 0, FALSE,0)); 255 !!(twarn > 0.0), twarn, !!(tcrit > 0.0), tcrit, true, 0, false,0));
256 256
257 if (pgquery) 257 if (pgquery)
258 query_status = do_query (conn, pgquery); 258 query_status = do_query (conn, pgquery);
@@ -393,7 +393,7 @@ process_arguments (int argc, char **argv)
393 393
394<para>&PROTO_validate_arguments;</para> 394<para>&PROTO_validate_arguments;</para>
395 395
396<para>Given a database name, this function returns TRUE if the string 396<para>Given a database name, this function returns true if the string
397is a valid PostgreSQL database name, and returns false if it is 397is a valid PostgreSQL database name, and returns false if it is
398not.</para> 398not.</para>
399 399
@@ -424,7 +424,7 @@ function prototype
424 424
425<para>&PROTO_is_pg_logname;</para> 425<para>&PROTO_is_pg_logname;</para>
426 426
427<para>Given a username, this function returns TRUE if the string is a 427<para>Given a username, this function returns true if the string is a
428valid PostgreSQL username, and returns false if it is not. Valid PostgreSQL 428valid PostgreSQL username, and returns false if it is not. Valid PostgreSQL
429usernames are less than &NAMEDATALEN; characters long and consist of 429usernames are less than &NAMEDATALEN; characters long and consist of
430letters, numbers, dashes, and underscores, plus possibly some other 430letters, numbers, dashes, and underscores, plus possibly some other
@@ -439,12 +439,10 @@ should be added.</para>
439 439
440 440
441 441
442int 442bool is_pg_logname (char *username) {
443is_pg_logname (char *username)
444{
445 if (strlen (username) > NAMEDATALEN - 1) 443 if (strlen (username) > NAMEDATALEN - 1)
446 return (FALSE); 444 return (false);
447 return (TRUE); 445 return (true);
448} 446}
449 447
450/****************************************************************************** 448/******************************************************************************