From: pcarana Date: Thu, 1 Oct 2020 17:31:17 +0000 (-0500) Subject: Minor fixes: add a couple of spaces, and 'pr_crit' at thread errors X-Git-Tag: v1.5.0~21 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e5119211d246288fe4e93b901aa58d6c3b9ca115;p=thirdparty%2FFORT-validator.git Minor fixes: add a couple of spaces, and 'pr_crit' at thread errors --- diff --git a/src/common.c b/src/common.c index 85d86893..fa1a1685 100644 --- a/src/common.c +++ b/src/common.c @@ -34,9 +34,8 @@ rwlock_read_lock(pthread_rwlock_t *lock) * pthread_rwlock_rdlock() failing like this is akin to `if` failing; * we're screwed badly, so let's just pull the trigger. */ - pr_op_err("pthread_rwlock_rdlock() returned error code %d. This is too critical for a graceful recovery; I must die now.", + pr_crit("pthread_rwlock_rdlock() returned error code %d. This is too critical for a graceful recovery; I must die now.", error); - exit(error); } void @@ -49,11 +48,9 @@ rwlock_write_lock(pthread_rwlock_t *lock) * Both of them indicate serious programming errors. */ error = pthread_rwlock_wrlock(lock); - if (error) { - pr_op_err("pthread_rwlock_wrlock() returned error code %d. This is too critical for a graceful recovery; I must die now.", + if (error) + pr_crit("pthread_rwlock_wrlock() returned error code %d. This is too critical for a graceful recovery; I must die now.", error); - exit(error); - } } void @@ -66,11 +63,9 @@ rwlock_unlock(pthread_rwlock_t *lock) * Both of them indicate serious programming errors. */ error = pthread_rwlock_unlock(lock); - if (error) { - pr_op_err("pthread_rwlock_unlock() returned error code %d. This is too critical for a graceful recovery; I must die now.", + if (error) + pr_crit("pthread_rwlock_unlock() returned error code %d. This is too critical for a graceful recovery; I must die now.", error); - exit(error); - } } void diff --git a/src/object/tal.c b/src/object/tal.c index f50bfe89..f18ee470 100644 --- a/src/object/tal.c +++ b/src/object/tal.c @@ -208,7 +208,7 @@ locate_char(char *str, size_t len, char find) { size_t i; - for(i = 0; i < len; i++) + for (i = 0; i < len; i++) if (str[i] == find) return str + i; return NULL; diff --git a/src/resource/asn.c b/src/resource/asn.c index 62e5757d..c80fa898 100644 --- a/src/resource/asn.c +++ b/src/resource/asn.c @@ -89,7 +89,7 @@ asn_node_cb(void *elem, void *arg) unsigned long index; int error; - for(index = node->min; index <= node->max; index++) { + for (index = node->min; index <= node->max; index++) { error = param->cb(index, param->arg); if (error) return error;