From 57bd5973e1bace9c7cf8889294c710b65462dee9 Mon Sep 17 00:00:00 2001 From: Chip Black Date: Thu, 3 Jul 2014 16:39:24 -0500 Subject: [PATCH] Various cleanup --- cgi/cgi_blerg.c | 2 ++ database/database.c | 1 - database/subscription.c | 4 ++-- tools/blerglatest.c | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cgi/cgi_blerg.c b/cgi/cgi_blerg.c index eec6fb3..ee0672b 100644 --- a/cgi/cgi_blerg.c +++ b/cgi/cgi_blerg.c @@ -471,4 +471,6 @@ int main(int argc, char *argv[]) { } cgi_quit(); + + return 0; } diff --git a/database/database.c b/database/database.c index fd8279c..9d96f43 100644 --- a/database/database.c +++ b/database/database.c @@ -167,7 +167,6 @@ struct blerg *blerg_open(const char *name) { int namelen = strlen(name); char filename[FILENAME_MAX]; struct stat st; - uint64_t sequence; if (!valid_name(name)) { fprintf(stderr, "Invalid name\n"); diff --git a/database/subscription.c b/database/subscription.c index aac7acf..c1633fe 100644 --- a/database/subscription.c +++ b/database/subscription.c @@ -88,12 +88,12 @@ struct blergref * subscription_list(const char *author, uint64_t offset, int *co int feed_fd = open(filename, O_RDONLY); if (feed_fd == -1) { perror("Could not open subscription feed"); - goto subscription_list_map_failed; + goto subscription_list_open_failed; } fstat(feed_fd, &st); if (st.st_size == 0) { - close(feed_fd); + fprintf(stderr, "Feed is empty\n"); goto subscription_list_map_failed; } n_subscription_records = st.st_size / sizeof(struct blergref); diff --git a/tools/blerglatest.c b/tools/blerglatest.c index 94c1679..ba12eae 100644 --- a/tools/blerglatest.c +++ b/tools/blerglatest.c @@ -81,7 +81,6 @@ struct things * latest_things(const char *path, const char *file, int minlen) { struct things * things = things_alloc(); char filename[512]; struct stat st; - int i; d = opendir(path); if (d == NULL) { @@ -169,4 +168,6 @@ int main(int argc, char *argv[]) { fwrite(buf, len, 1, stdout); yajl_gen_free(g); + + return 0; } -- 2.25.1