diff options
| -rw-r--r-- | plugins/check_pgsql.c | 16 |
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 **); | |||
| 69 | int validate_arguments (void); | 69 | int validate_arguments (void); |
| 70 | void print_usage (void); | 70 | void print_usage (void); |
| 71 | void print_help (void); | 71 | void print_help (void); |
| 72 | int is_pg_logname (char *); | 72 | bool is_pg_logname (char *); |
| 73 | int do_query (PGconn *, char *); | 73 | int do_query (PGconn *, char *); |
| 74 | 74 | ||
| 75 | char *pghost = NULL; /* host name of the backend server */ | 75 | char *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 |
| 397 | is a valid PostgreSQL database name, and returns false if it is | 397 | is a valid PostgreSQL database name, and returns false if it is |
| 398 | not.</para> | 398 | not.</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 |
| 428 | valid PostgreSQL username, and returns false if it is not. Valid PostgreSQL | 428 | valid PostgreSQL username, and returns false if it is not. Valid PostgreSQL |
| 429 | usernames are less than &NAMEDATALEN; characters long and consist of | 429 | usernames are less than &NAMEDATALEN; characters long and consist of |
| 430 | letters, numbers, dashes, and underscores, plus possibly some other | 430 | letters, numbers, dashes, and underscores, plus possibly some other |
| @@ -439,12 +439,10 @@ should be added.</para> | |||
| 439 | 439 | ||
| 440 | 440 | ||
| 441 | 441 | ||
| 442 | int | 442 | bool is_pg_logname (char *username) { |
| 443 | is_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 | /****************************************************************************** |
