From: Thibault Godouet Date: Sat, 24 Aug 2024 15:44:49 +0000 (+0100) Subject: Rename boolean variable names. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8efc1e6eda2f6c8e5248fd7055cbea5ec53dca8;p=thirdparty%2Ffcron.git Rename boolean variable names. --- diff --git a/fcrondyn_svr.c b/fcrondyn_svr.c index 11e7475..d7069e7 100644 --- a/fcrondyn_svr.c +++ b/fcrondyn_svr.c @@ -251,9 +251,7 @@ auth_client_so_peercred(struct fcrondyn_cl *client) * Sets client->fcl_user on success, don't do anything on failure * so that the client stays unauthenticated */ { - /* [@PR #17] renamed (previously called 'true') to avoid conflict with - stdbool */ - const int value = 1; + const int true_val = 1; /* There is no ucred.h (or equivalent) on linux to define struct ucred (!!) * so we do it here */ #if ! ( defined(HAVE_CRED_H) && defined(HAVE_UCRED_H) \ @@ -268,8 +266,8 @@ auth_client_so_peercred(struct fcrondyn_cl *client) socklen_t cred_size = sizeof(cred); struct passwd *p_entry = NULL; - setsockopt(client->fcl_sock_fd, SOL_SOCKET, SO_PASSCRED, &value, - sizeof(value)); + setsockopt(client->fcl_sock_fd, SOL_SOCKET, SO_PASSCRED, &true_val, + sizeof(true_val)); if (getsockopt (client->fcl_sock_fd, SOL_SOCKET, SO_PEERCRED, &cred, &cred_size) != 0) { diff --git a/fileconf.c b/fileconf.c index 99b7923..f7c6539 100644 --- a/fileconf.c +++ b/fileconf.c @@ -458,42 +458,40 @@ assign_option_string(char **var, char *value) } -/* [@PR #17] renamed labels 'true' and 'false' to avoid conflict with - stdbool */ char * get_bool(char *ptr, int *i) /* get a bool value : either true (1) or false (0) * return NULL on error */ { if (*ptr == '1') - goto conf_true; + goto true_val; else if (*ptr == '0') - goto conf_false; + goto false_val; else if (strncmp(ptr, "true", 4) == 0) { ptr += 3; - goto conf_true; + goto true_val; } else if (strncmp(ptr, "yes", 3) == 0) { ptr += 2; - goto conf_true; + goto true_val; } else if (strncmp(ptr, "false", 5) == 0) { ptr += 4; - goto conf_false; + goto false_val; } else if (strncmp(ptr, "no", 2) == 0) { ptr += 1; - goto conf_false; + goto false_val; } else return NULL; - conf_true: + true_val: *i = true; ptr++; return ptr; - conf_false: + false_val: *i = false; ptr++; return ptr;