From 7516d64a63bf0c4105a20a18fbc4f0968b17bacd Mon Sep 17 00:00:00 2001 From: Andrew Otto Date: Tue, 18 Feb 2014 16:38:19 -0500 Subject: [PATCH] Fixing space/tab inconsistencies Change-Id: Ia4a3a9fdd4c7db0de03f72703a5032081b666728 --- exec.c | 8 +++---- ezd.c | 2 +- format.c | 6 ++--- input.c | 8 +++---- kafkatee.c | 70 +++++++++++++++++++++++++++--------------------------- output.c | 18 +++++++------- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/exec.c b/exec.c index 87c3dc0..f0626f9 100644 --- a/exec.c +++ b/exec.c @@ -183,8 +183,8 @@ int kt_popen (const char *cmdstring, const char *rw, } /* Execute command */ - execl("/bin/sh", "sh", "-c", cmdstring, NULL); - _exit(127); + execl("/bin/sh", "sh", "-c", cmdstring, NULL); + _exit(127); } @@ -273,8 +273,8 @@ static void *exec_main (void *ignore) { struct child_proc *cp; /* Install SIGCHLD handler to reap dying child processes */ - ezd_thread_sigmask(SIG_BLOCK, 0/*ALL*/, -1/*end*/); - ezd_thread_sigmask(SIG_UNBLOCK, SIGCHLD, -1/*end*/); + ezd_thread_sigmask(SIG_BLOCK, 0/*ALL*/, -1/*end*/); + ezd_thread_sigmask(SIG_UNBLOCK, SIGCHLD, -1/*end*/); signal(SIGCHLD, sigchld); while (conf.run || child_proc_cnt > 0) { diff --git a/ezd.c b/ezd.c index c0afe3a..c007f9c 100644 --- a/ezd.c +++ b/ezd.c @@ -299,7 +299,7 @@ int ezd_conf_file_read (const char *path, "Failed to read include file pattern '%s'", t); inc_depth--; return -1; - } + } /* For each matched include file, call ezd_conf_file_read. */ for (g = 0; g < glob_matches.gl_pathc; g++) { diff --git a/format.c b/format.c index 9d4dcf7..28c08bf 100644 --- a/format.c +++ b/format.c @@ -297,7 +297,7 @@ static int jp_bool (void *opaque, int val) { static int jp_number (void *opaque, const char *numval, - YAJL_SIZE_TYPE numlen) { + YAJL_SIZE_TYPE numlen) { struct json_parse_ctx *jp = opaque; _JP_CHECK(); @@ -307,7 +307,7 @@ static int jp_number (void *opaque, const char *numval, static int jp_string (void *opaque, const unsigned char *val, - YAJL_SIZE_TYPE len) { + YAJL_SIZE_TYPE len) { struct json_parse_ctx *jp = opaque; _JP_CHECK(); @@ -323,7 +323,7 @@ static int jp_start_map (void *opaque) { static int jp_map_key (void *opaque, const unsigned char *key, - YAJL_SIZE_TYPE len) { + YAJL_SIZE_TYPE len) { struct json_parse_ctx *jp = opaque; const struct fmtvar *fmtvar; diff --git a/input.c b/input.c index 2f60e2a..4c35205 100644 --- a/input.c +++ b/input.c @@ -93,7 +93,7 @@ static void input_pipe_main (input_t *in) { int status; /* pipe exit status */ char errstr[512]; char *buf; - static int our_rotate_version = 0; + static int our_rotate_version = 0; buf = malloc(conf.input_buf_size); @@ -167,9 +167,9 @@ static void input_pipe_main (input_t *in) { } if (unlikely(conf.rotate != our_rotate_version)) { - our_rotate_version = conf.rotate; + our_rotate_version = conf.rotate; break; - } + } } _DBG("Input \"%s\" Status=%i, EOF=%i, Error=%i", in->in_name, @@ -293,7 +293,7 @@ static void input_kafka_main (input_t *in) { static void *input_main (void *arg) { input_t *in = arg; - ezd_thread_sigmask(SIG_BLOCK, 0/*ALL*/, -1/*end*/); + ezd_thread_sigmask(SIG_BLOCK, 0/*ALL*/, -1/*end*/); switch (in->in_type) { diff --git a/kafkatee.c b/kafkatee.c index 29d76b2..cd19569 100644 --- a/kafkatee.c +++ b/kafkatee.c @@ -42,7 +42,7 @@ #include "ezd.h" static void sighup (int sig) { - static int rotate_version = 0; + static int rotate_version = 0; conf.rotate = ++rotate_version; } @@ -74,11 +74,11 @@ static void kafka_error_cb (rd_kafka_t *rk, int err, * Kafka statistics callback. */ static int kafka_stats_cb (rd_kafka_t *rk, char *json, size_t json_len, - void *opaque) { - if (!conf.stats_fp) - return 0; + void *opaque) { + if (!conf.stats_fp) + return 0; - fprintf(conf.stats_fp, "{ \"kafka\": %s }\n", json); + fprintf(conf.stats_fp, "{ \"kafka\": %s }\n", json); return 0; } @@ -86,28 +86,28 @@ static int kafka_stats_cb (rd_kafka_t *rk, char *json, size_t json_len, * Output kafkatee specific stats to statsfile. */ static void stats_print (void) { - /* FIXME: Currently none */ + /* FIXME: Currently none */ } static void stats_close (void) { - stats_print(); - fclose(conf.stats_fp); - conf.stats_fp = NULL; + stats_print(); + fclose(conf.stats_fp); + conf.stats_fp = NULL; } static int stats_open (void) { - /* Already open? close and then reopen */ - if (conf.stats_fp) - stats_close(); - - if (!(conf.stats_fp = fopen(conf.stats_file, "a"))) { - kt_log(LOG_ERR, - "Failed to open statistics log file %s: %s", - conf.stats_file, strerror(errno)); - return -1; - } - - return 0; + /* Already open? close and then reopen */ + if (conf.stats_fp) + stats_close(); + + if (!(conf.stats_fp = fopen(conf.stats_file, "a"))) { + kt_log(LOG_ERR, + "Failed to open statistics log file %s: %s", + conf.stats_file, strerror(errno)); + return -1; + } + + return 0; } @@ -142,7 +142,7 @@ int main (int argc, char **argv) { char errstr[512]; char c; int r; - static int our_rotate_version = 0; + static int our_rotate_version = 0; /* * Default configuration @@ -245,7 +245,7 @@ int main (int argc, char **argv) { if (conf.stats_interval) { char tmp[30]; - if (stats_open() == -1) { + if (stats_open() == -1) { fprintf(stderr, "Failed to open statistics log file %s: %s\n", conf.stats_file, strerror(errno)); @@ -287,17 +287,17 @@ int main (int argc, char **argv) { "with exit code %i", conf.cmd_init, r); } - /* Block all signals in the main thread so new threads get the same - * procmask. */ - ezd_thread_sigmask(SIG_BLOCK, 0/*ALL*/, -1/*end*/); + /* Block all signals in the main thread so new threads get the same + * procmask. */ + ezd_thread_sigmask(SIG_BLOCK, 0/*ALL*/, -1/*end*/); /* Start IO */ outputs_start(); inputs_start(); - /* Set main thread sigmask */ - ezd_thread_sigmask(SIG_UNBLOCK, SIGHUP, SIGINT, SIGTERM, -1); + /* Set main thread sigmask */ + ezd_thread_sigmask(SIG_UNBLOCK, SIGHUP, SIGINT, SIGTERM, -1); signal(SIGHUP, sighup); signal(SIGINT, term); signal(SIGTERM, term); @@ -305,12 +305,12 @@ int main (int argc, char **argv) { /* Main loop */ while (conf.run) { rd_kafka_poll(conf.rk, 1000); - if (unlikely(conf.rotate != our_rotate_version)) { - our_rotate_version = conf.rotate; - if (conf.stats_interval) - stats_open(); - } - } + if (unlikely(conf.rotate != our_rotate_version)) { + our_rotate_version = conf.rotate; + if (conf.stats_interval) + stats_open(); + } + } inputs_term(); outputs_term(); @@ -321,7 +321,7 @@ int main (int argc, char **argv) { /* if stats_fp is set (i.e. open), close it. */ if (conf.stats_fp) - stats_close(); + stats_close(); free(conf.stats_file); /* Run termination command, if any. */ diff --git a/output.c b/output.c index 4875599..32e3543 100644 --- a/output.c +++ b/output.c @@ -356,11 +356,11 @@ static void outputs_check (void) { /* Already open */ if (o->o_fd != -1) { - if (o->o_type == OUTPUT_PIPE && - o->o_pipe.status != -1) - output_close(o, LOG_WARNING, - exec_exitstatus(o->o_pipe.status)); - continue; + if (o->o_type == OUTPUT_PIPE && + o->o_pipe.status != -1) + output_close(o, LOG_WARNING, + exec_exitstatus(o->o_pipe.status)); + continue; } /* Last open failed: back off */ @@ -414,10 +414,10 @@ static void *outputs_main (void *ignore) { struct epoll_event *ev; time_t t_last_check = 0; output_t *o; - static int our_rotate_version = 0; + static int our_rotate_version = 0; - /* Block all signals in this thread */ - ezd_thread_sigmask(SIG_BLOCK, 0/*ALL*/, -1/*end*/); + /* Block all signals in this thread */ + ezd_thread_sigmask(SIG_BLOCK, 0/*ALL*/, -1/*end*/); ev = malloc(sizeof(*ev) * outputs_cnt); @@ -428,7 +428,7 @@ static void *outputs_main (void *ignore) { if (unlikely(conf.rotate != our_rotate_version)) { /* Outputs rotation */ - our_rotate_version = conf.rotate; + our_rotate_version = conf.rotate; outputs_rotate(); } else { /* Periodic outputs checker */