Various cleanup
authorChip Black <bytex64@bytex64.net>
Thu, 3 Jul 2014 21:39:24 +0000 (16:39 -0500)
committerChip Black <bytex64@bytex64.net>
Thu, 3 Jul 2014 21:39:24 +0000 (16:39 -0500)
cgi/cgi_blerg.c
database/database.c
database/subscription.c
tools/blerglatest.c

index eec6fb3..ee0672b 100644 (file)
@@ -471,4 +471,6 @@ int main(int argc, char *argv[]) {
        }
 
        cgi_quit();
+
+       return 0;
 }
index fd8279c..9d96f43 100644 (file)
@@ -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");
index aac7acf..c1633fe 100644 (file)
@@ -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);
index 94c1679..ba12eae 100644 (file)
@@ -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;
 }