Skip to content

Commit

Permalink
s/ERROR/PERROR/ (where appropriate)
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Apr 28, 2017
1 parent 8bea1c3 commit ece5ebf
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/main/connection.c
Expand Up @@ -1047,7 +1047,7 @@ fr_connection_pool_t *fr_connection_pool_init(TALLOC_CTX *ctx,
memcpy(&mutable, &cs, sizeof(mutable));

if (cf_section_parse(pool, pool, mutable, connection_config) < 0) {
ERROR("Configuration parsing failed: %s", fr_strerror());
PERROR("Configuration parsing failed");
goto error;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/process.c
Expand Up @@ -1906,7 +1906,7 @@ static void tcp_socket_timer(UNUSED fr_event_list_t *eel, struct timeval *now, v
pthread_mutex_lock(&proxy_mutex);
if (!fr_packet_list_socket_freeze(proxy_list,
listener->fd)) {
ERROR("Fatal error freezing socket: %s", fr_strerror());
PERROR("Fatal error freezing socket");
fr_exit(1);
}
pthread_mutex_unlock(&proxy_mutex);
Expand Down Expand Up @@ -4919,7 +4919,7 @@ static int event_new_fd(rad_listen_t *this)
* All sockets: add the FD to the event handler.
*/
if (fr_event_fd_insert(el, this->fd, event_socket_handler, NULL, event_socket_error, this)) {
ERROR("Failed adding event handler for socket: %s", fr_strerror());
PERROR("Failed adding event handler for socket");
fr_exit(1);
}

Expand Down Expand Up @@ -5007,7 +5007,7 @@ static int event_new_fd(rad_listen_t *this)
pthread_mutex_lock(&proxy_mutex);
if (!fr_packet_list_socket_freeze(proxy_list,
this->fd)) {
ERROR("Fatal error freezing socket: %s", fr_strerror());
PERROR("Fatal error freezing socket");
fr_exit(1);
}

Expand Down Expand Up @@ -5439,7 +5439,7 @@ int radius_event_start(bool have_children)
DEBUG4("Created signal pipe. Read end FD %i, write end FD %i", self_pipe[0], self_pipe[1]);

if (fr_event_fd_insert(el, self_pipe[0], event_signal_handler, NULL, NULL, el) < 0) {
ERROR("Failed creating signal pipe handler: %s", fr_strerror());
PERROR("Failed creating signal pipe handler");
return -1;
}

Expand Down
12 changes: 6 additions & 6 deletions src/main/radiusd.c
Expand Up @@ -549,7 +549,7 @@ int main(int argc, char *argv[])
* Initialise the SNMP stats structures
*/
if (fr_snmp_init() < 0) {
ERROR("Failed initialising SNMP: %s", fr_strerror());
PERROR("Failed initialising SNMP");
fr_exit(EXIT_FAILURE);
}

Expand All @@ -566,7 +566,7 @@ int main(int argc, char *argv[])
* Redirect stderr/stdout as appropriate.
*/
if (fr_log_init(&default_log, main_config.daemonize) < 0) {
ERROR("Failed initialising log: %s", fr_strerror());
PERROR("Failed initialising log");
fr_exit(EXIT_FAILURE);
}

Expand All @@ -585,7 +585,7 @@ int main(int argc, char *argv[])
size = talloc_total_size(main_config.config);

if (talloc_set_memlimit(main_config.config, size)) {
ERROR("Failed setting memory limit for global configuration");
PERROR("Failed setting memory limit for global configuration");
} else {
DEBUG3("Memory limit for global configuration is set to %zd bytes", size);
}
Expand All @@ -611,7 +611,7 @@ int main(int argc, char *argv[])
|| (fr_set_signal(SIGQUIT, sig_fatal) < 0)
#endif
) {
ERROR("Failed installing signal handler: %s", fr_strerror());
PERROR("Failed installing signal handler");
fr_exit(EXIT_FAILURE);
}

Expand All @@ -635,7 +635,7 @@ int main(int argc, char *argv[])

if ((fr_set_signal(SIGHUP, sig_hup) < 0) ||
(fr_set_signal(SIGTERM, sig_fatal) < 0)) {
ERROR("Failed installing signal handler: %s", fr_strerror());
PERROR("Failed installing signal handler");
fr_exit(EXIT_FAILURE);
}

Expand Down Expand Up @@ -700,7 +700,7 @@ int main(int argc, char *argv[])
}

if (status < 0) {
ERROR("Exiting due to internal error: %s", fr_strerror());
PERROR("Exiting due to internal error");
rcode = EXIT_FAILURE;
} else {
INFO("Exiting normally");
Expand Down
2 changes: 1 addition & 1 deletion src/main/radsnmp.c
Expand Up @@ -994,7 +994,7 @@ int main(int argc, char **argv)

case 't':
if (fr_timeval_from_str(&conf->timeout, optarg) < 0) {
ERROR("Failed parsing timeout value: %s", fr_strerror());
ERROR("Failed parsing timeout valueL %s", fr_strerror());
exit(EXIT_FAILURE);
}
break;
Expand Down
2 changes: 1 addition & 1 deletion src/main/realms.c
Expand Up @@ -2305,7 +2305,7 @@ REALM *realm_find(char const *name)

compare = regex_exec(this->preg, name, strlen(name), NULL, NULL);
if (compare < 0) {
ERROR("Failed performing realm comparison: %s", fr_strerror());
PERROR("Failed performing realm comparison");
return NULL;
}
if (compare == 1) return this->realm;
Expand Down
2 changes: 1 addition & 1 deletion src/main/unit_test_module.c
Expand Up @@ -125,7 +125,7 @@ static RADCLIENT *client_alloc(void *ctx, char const *ip, char const *name)

client = client_afrom_cs(ctx, cs, NULL, false);
if (!client) {
ERROR("Failed creating test client: %s", fr_strerror());
PERROR("Failed creating test client");
rad_assert(0);
}
rad_assert(client);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/proto_arp/proto_arp.c
Expand Up @@ -95,7 +95,7 @@ static int arp_socket_recv(rad_listen_t *listener)

link_len = fr_link_layer_offset(data, header->caplen, sock->lsock.pcap->link_layer);
if (link_len < 0) {
ERROR("Failed determining link layer header offset: %s", fr_strerror());
PERROR("Failed determining link layer header offset");
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/proto_bfd/proto_bfd.c
Expand Up @@ -338,7 +338,7 @@ static int bfd_pthread_create(bfd_state_t *session)
#endif

if (fr_event_fd_insert(session->el, session->pipefd[0], bfd_pipe_recv, NULL, NULL, session) < 0) {
ERROR("Failed inserting file descriptor into event list: %s", fr_strerror());
PERROR("Failed inserting file descriptor into event list");
goto close_pipes;
}

Expand Down
10 changes: 5 additions & 5 deletions src/modules/proto_ldap_sync/proto_ldap_sync.c
Expand Up @@ -529,7 +529,7 @@ static void proto_ldap_sync_reinit(fr_event_list_t *el, struct timeval *now, voi
*/
if (sync_state_init(inst->conn, config, NULL, true) == 0) return;

ERROR("Failed reinitialising sync, will retry in %pT seconds", &inst->sync_retry_interval);
PERROR("Failed reinitialising sync, will retry in %pT seconds", &inst->sync_retry_interval);

fr_timeval_add(&when, now, &inst->sync_retry_interval);
if (fr_event_timer_insert(el, proto_ldap_sync_reinit, user_ctx, &when, &inst->sync_retry_ev) < 0) {
Expand Down Expand Up @@ -742,7 +742,7 @@ static RADCLIENT *proto_ldap_fake_client_alloc(proto_ldap_inst_t *inst)

client = client_afrom_cs(inst, cs, NULL, false);
if (!client) {
ERROR("Failed creating fake LDAP client: %s", fr_strerror());
PERROR("Failed creating fake LDAP client");
talloc_free(cs);
return NULL;
}
Expand Down Expand Up @@ -876,7 +876,7 @@ static int proto_ldap_socket_recv(rad_listen_t *listen)
return 1;

case -1:
ERROR("Sync failed - will retry in %pT seconds", &inst->sync_retry_interval);
PERROR("Sync failed - will retry in %pT seconds", &inst->sync_retry_interval);

config = sync_state_config_get(inst->conn, sync_id);
sync_state_destroy(inst->conn, sync_id); /* Destroy the old state */
Expand All @@ -893,7 +893,7 @@ static int proto_ldap_socket_recv(rad_listen_t *listen)
return 1;

case -2:
ERROR("Connection failed - will retry in %pT seconds", &inst->conn_retry_interval);
PERROR("Connection failed - will retry in %pT seconds", &inst->conn_retry_interval);

/*
* Schedule conn reinit, but don't perform it immediately
Expand Down Expand Up @@ -958,7 +958,7 @@ static int proto_ldap_socket_open(UNUSED CONF_SECTION *cs, rad_listen_t *listen)
error:
TALLOC_FREE(inst->conn);

ERROR("Failed (re)initialising connection, will retry in %pT seconds",
PERROR("Failed (re)initialising connection, will retry in %pT seconds",
&inst->conn_retry_interval);

fr_timeval_add(&when, &now, &inst->conn_retry_interval);
Expand Down
6 changes: 3 additions & 3 deletions src/modules/rlm_ldap/rlm_ldap.c
Expand Up @@ -1400,7 +1400,7 @@ static int parse_sub_section(rlm_ldap_t *inst, CONF_SECTION *parent, ldap_acct_s

*config = talloc_zero(inst, ldap_acct_section_t);
if (cf_section_parse(*config, *config, cs, acct_section_config) < 0) {
ERROR("rlm_ldap (%s) - Failed parsing configuration for section %s", inst->name, name);
PERROR("rlm_ldap (%s) - Failed parsing configuration for section %s", inst->name, name);

return -1;
}
Expand Down Expand Up @@ -1442,7 +1442,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)

if (paircompare_register_byname(group_attribute, fr_dict_attr_by_num(NULL, 0, PW_USER_NAME),
false, rlm_ldap_groupcmp, inst) < 0) {
ERROR("Error registering group comparison: %s", fr_strerror());
PERROR("Error registering group comparison");
goto error;
}

Expand All @@ -1457,7 +1457,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)
memset(&flags, 0, sizeof(flags));
if (fr_dict_attr_add(NULL, fr_dict_root(fr_dict_internal), inst->cache_attribute, -1, PW_TYPE_STRING,
flags) < 0) {
ERROR("Error creating cache attribute: %s", fr_strerror());
PERROR("Error creating cache attribute");
error:
return -1;

Expand Down
6 changes: 3 additions & 3 deletions src/modules/rlm_linelog/rlm_linelog.c
Expand Up @@ -205,7 +205,7 @@ static void *mod_conn_create(TALLOC_CTX *ctx, void *instance, struct timeval con
DEBUG2("Opening UNIX socket at \"%s\"", inst->unix_sock.path);
sockfd = fr_socket_client_unix(inst->unix_sock.path, true);
if (sockfd < 0) {
ERROR("Failed opening UNIX socket: %s", fr_strerror());
PERROR("Failed opening UNIX socket");
return NULL;
}
break;
Expand All @@ -221,7 +221,7 @@ static void *mod_conn_create(TALLOC_CTX *ctx, void *instance, struct timeval con

sockfd = fr_socket_client_tcp(NULL, &inst->tcp.dst_ipaddr, inst->tcp.port, true);
if (sockfd < 0) {
ERROR("Failed opening TCP socket: %s", fr_strerror());
PERROR("Failed opening TCP socket");
return NULL;
}
break;
Expand All @@ -237,7 +237,7 @@ static void *mod_conn_create(TALLOC_CTX *ctx, void *instance, struct timeval con

sockfd = fr_socket_client_udp(NULL, &inst->udp.dst_ipaddr, inst->udp.port, true);
if (sockfd < 0) {
ERROR("Failed opening UDP socket: %s", fr_strerror());
PERROR("Failed opening UDP socket");
return NULL;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/rlm_radius_client/rlm_radius_client.c
Expand Up @@ -341,7 +341,7 @@ static int mod_fd_add(fr_event_list_t *el, rlm_radius_client_conn_t *conn, rlm_r
* Too many outbound sockets is probably a bad idea.
*/
if (conn->num_fds > 16) {
ERROR("Too many open sockets (%d)", conn->num_fds);
PERROR("Too many open sockets (%d)", conn->num_fds);
return -1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/rlm_rest/io.c
Expand Up @@ -221,7 +221,7 @@ static int _rest_io_timer_modify(CURLM *mandle, long timeout_ms, void *ctx)

if (timeout_ms < 0) {
if (fr_event_timer_delete(t->el, &t->ev) < 0) {
ERROR("Failed deleting multi-handle timer: %s", fr_strerror());
PERROR("Failed deleting multi-handle timer");
return -1;
}
DEBUG3("multi-handle %p timer removed", mandle);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/rlm_sql/rlm_sql.c
Expand Up @@ -1137,7 +1137,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)
*/
if (paircompare_register_byname(group_attribute, fr_dict_attr_by_num(NULL, 0, PW_USER_NAME),
false, sql_groupcmp, inst) < 0) {
ERROR("Failed registering group comparison: %s", fr_strerror());
PERROR("Failed registering group comparison");
goto error;
}

Expand Down
4 changes: 2 additions & 2 deletions src/modules/rlm_unix/rlm_unix.c
Expand Up @@ -137,7 +137,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)

group_da = fr_dict_attr_by_num(fr_dict_internal, 0, PW_GROUP);
if (!group_da) {
ERROR("&Group attribute not found in dictionary");
PERROR("&Group attribute not found in dictionary");
return -1;
}

Expand Down Expand Up @@ -169,7 +169,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)
false,
groupcmp,
inst) < 0) {
ERROR("Failed registering Unix-Group: %s", fr_strerror());
PERROR("Failed registering Unix-Group");
return -1;
}

Expand Down
4 changes: 2 additions & 2 deletions src/modules/rlm_winbind/rlm_winbind.c
Expand Up @@ -278,7 +278,7 @@ static void *mod_conn_create(TALLOC_CTX *ctx, UNUSED void *instance, UNUSED stru
*wb_ctx = wbcCtxCreate();

if (*wb_ctx == NULL) {
ERROR("failed to create winbind context");
PERROR("failed to create winbind context");
talloc_free(wb_ctx);
return NULL;
}
Expand Down Expand Up @@ -327,7 +327,7 @@ static int mod_bootstrap(CONF_SECTION *conf, void *instance)

if (paircompare_register_byname(group_attribute, user_name_da, false,
winbind_group_cmp, inst) < 0) {
ERROR("Error registering group comparison: %s", fr_strerror());
PERROR("Error registering group comparison");
return -1;
}

Expand Down

0 comments on commit ece5ebf

Please sign in to comment.