Re-format code to avoid overly long lines and declarations
This commit is contained in:
+2
-2
@@ -3,7 +3,7 @@
|
||||
|
||||
static void
|
||||
uc_sift(unsigned char *base, size_t start, size_t count, size_t width,
|
||||
uc_hs_cmp cmp, uc_hs_swp swap, void *cookie)
|
||||
i uc_hs_cmp cmp, uc_hs_swp swap, void *cookie)
|
||||
{
|
||||
size_t root = start, child;
|
||||
|
||||
@@ -27,7 +27,7 @@ uc_sift(unsigned char *base, size_t start, size_t count, size_t width,
|
||||
|
||||
void
|
||||
uc_heapsort(void *base_, size_t count, size_t width,
|
||||
uc_hs_cmp cmp, uc_hs_swp swap, void *cookie)
|
||||
uc_hs_cmp cmp, uc_hs_swp swap, void *cookie)
|
||||
{
|
||||
long start;
|
||||
long end;
|
||||
|
||||
@@ -28,7 +28,10 @@ uc_hex_encode(const uint8_t *restrict in, size_t len, char *restrict out)
|
||||
}
|
||||
|
||||
char*
|
||||
uc_hex_encode_delim(const uint8_t *restrict in, size_t inlen, char *restrict out, int outlen, const char *restrict delim)
|
||||
uc_hex_encode_delim(
|
||||
const uint8_t *restrict in, size_t inlen,
|
||||
char *restrict out, int outlen,
|
||||
const char *restrict delim)
|
||||
{
|
||||
size_t i;
|
||||
char *outp = out;
|
||||
|
||||
+4
-1
@@ -198,7 +198,10 @@ struct UCLogDestination *uc_log_new_stderr(enum UC_LOG_LEVEL log_level, int log_
|
||||
return dest;
|
||||
}
|
||||
|
||||
struct UCLogDestination *uc_log_new_syslog(const char *ident, int facility, enum UC_LOG_LEVEL log_level, int log_location)
|
||||
struct UCLogDestination *uc_log_new_syslog(const char *ident,
|
||||
int facility,
|
||||
enum UC_LOG_LEVEL log_level,
|
||||
int log_location)
|
||||
{
|
||||
struct UCLogDestination *dest = calloc(1, sizeof *dest);
|
||||
char *id;
|
||||
|
||||
+5
-1
@@ -40,7 +40,11 @@ uint8_t *uc_mbuf_pull(struct MBuf *mbuf, uint32_t size)
|
||||
return data;
|
||||
}
|
||||
|
||||
void uc_mbuf_init(struct MBuf *mbuf, uint8_t *restrict buf, uint32_t len, uint32_t headroom, uint32_t flags)
|
||||
void uc_mbuf_init(struct MBuf *mbuf,
|
||||
uint8_t *restrict buf,
|
||||
uint32_t len,
|
||||
uint32_t headroom,
|
||||
uint32_t flags)
|
||||
{
|
||||
mbuf->bufstart = buf;
|
||||
mbuf->p1 = mbuf->p2 = mbuf->p3 = mbuf->p4 = NULL;
|
||||
|
||||
@@ -20,8 +20,7 @@ static UCRCResult uc_restart_counter_lock(int fd)
|
||||
return UC_RC_OK;
|
||||
}
|
||||
|
||||
UCRCResult uc_restart_counter_init(
|
||||
struct UCRestartCounter *counter,
|
||||
UCRCResult uc_restart_counter_init(struct UCRestartCounter *counter,
|
||||
const char *filename,
|
||||
unsigned int flags)
|
||||
{
|
||||
|
||||
+10
-5
@@ -66,18 +66,22 @@ again:
|
||||
}
|
||||
|
||||
if (WIFSIGNALED(status)) {
|
||||
syslog(LOG_ERR, "supervised process(pid %ld) exited cause of signal %d, status = 0x%X", (long)pid, WTERMSIG(status), status);
|
||||
syslog(LOG_ERR, "supervised process(pid %ld) exited cause of signal %d, status = 0x%X",
|
||||
(long)pid, WTERMSIG(status), status);
|
||||
return RESTART;
|
||||
} else if (WIFEXITED(status)) {
|
||||
syslog(LOG_ERR, "supervised process(pid %ld) exited with code %d, status = 0x%X", (long)pid, WTERMSIG(status), status);
|
||||
syslog(LOG_ERR, "supervised process(pid %ld) exited with code %d, status = 0x%X",
|
||||
(long)pid, WTERMSIG(status), status);
|
||||
return RESTART;
|
||||
}
|
||||
|
||||
/* Ok, can we ever get here ? */
|
||||
|
||||
syslog(LOG_ERR, "waitpid of supervised process(pid %ld) status = 0x%X", (long)pid, status);
|
||||
syslog(LOG_ERR, "waitpid of supervised process(pid %ld) status = 0x%X",
|
||||
(long)pid, status);
|
||||
if (kill(pid, 0) == 0) {
|
||||
syslog(LOG_ERR, "supervised process(pid %ld) seems to still be alive, not restarting", (long)pid);
|
||||
syslog(LOG_ERR, "supervised process(pid %ld) seems to still be alive, not restarting",
|
||||
(long)pid);
|
||||
goto again;
|
||||
}
|
||||
|
||||
@@ -134,7 +138,8 @@ int uc_supervise(void)
|
||||
switch (cmd) {
|
||||
|
||||
case CLEAN_EXIT:
|
||||
syslog(LOG_INFO, "Terminating supervised pid %lu", (unsigned long)pid);
|
||||
syslog(LOG_INFO, "Terminating supervised pid %lu",
|
||||
(unsigned long)pid);
|
||||
kill_supervised_process(pid);
|
||||
wait(NULL);
|
||||
syslog(LOG_INFO, "Exiting");
|
||||
|
||||
+2
-2
@@ -281,8 +281,8 @@ unsigned int uc_thread_queue_length(struct uc_threadqueue *queue)
|
||||
}
|
||||
|
||||
int uc_thread_queue_clear(struct uc_threadqueue *queue,
|
||||
uc_thread_queue_walk_func free_func,
|
||||
void *cookie)
|
||||
uc_thread_queue_walk_func free_func,
|
||||
void *cookie)
|
||||
{
|
||||
if (queue == NULL) {
|
||||
return EINVAL;
|
||||
|
||||
+3
-1
@@ -13,7 +13,9 @@ int uc_ticket_lock_init(struct UCTicketLock *lock)
|
||||
return uc_ticket_lock_init_ex(lock, NULL, NULL);
|
||||
}
|
||||
|
||||
int uc_ticket_lock_init_ex(struct UCTicketLock *lock, pthread_mutexattr_t *mattr, pthread_condattr_t *cattr)
|
||||
int uc_ticket_lock_init_ex(struct UCTicketLock *lock,
|
||||
pthread_mutexattr_t *mattr,
|
||||
pthread_condattr_t *cattr)
|
||||
{
|
||||
int rc;
|
||||
lock->queue_head = 0;
|
||||
|
||||
Reference in New Issue
Block a user