Diff options
-rw-r--r--source/cache.c5
-rw-r--r--source/cache.h2
-rw-r--r--source/config.c7
-rw-r--r--source/config.h2
4 files changed, 7 insertions, 9 deletions
diff --git a/source/cache.c b/source/cache.c
index efe8185..be1a3c9 100644
--- a/source/cache.c
+++ b/source/cache.c
@@ -519,7 +519,7 @@ int cache_process(int size, const char *path, const char *key, int ttl, size_t m
return result;
}
-int cache_ls(const char *path)
+void cache_ls(const char *path)
{
DIR *dir;
struct dirent *ent;
@@ -536,7 +536,7 @@ int cache_ls(const char *path)
if (!dir) {
err = errno;
fprintf(stderr, "[cgit] Unable to open %s: %s (%d)\n", path, strerror(err), err);
- return err;
+ return;
}
strbuf_addstr(&slot_path, path);
strbuf_ensure_end(&slot_path, '/');
@@ -569,5 +569,4 @@ int cache_ls(const char *path)
}
closedir(dir);
strbuf_release(&slot_path);
- return 0;
}
diff --git a/source/cache.h b/source/cache.h
index d3a7ec4..b73a6f4 100644
--- a/source/cache.h
+++ b/source/cache.h
@@ -27,7 +27,7 @@ extern int cache_process(int size, const char *path, const char *key, int ttl,
* Write one line per cache slot to stdout, giving its path, modification time,
* size and key.
*/
-extern int cache_ls(const char *path);
+extern void cache_ls(const char *path);
/*
* Give up on the slot being filled and put stdout back on the client, after
diff --git a/source/config.c b/source/config.c
index b029613..49cd398 100644
--- a/source/config.c
+++ b/source/config.c
@@ -85,7 +85,7 @@ static int read_entry(FILE *f, struct strbuf *name, struct strbuf *value)
}
}
-int config_file_parse(const char *filename, config_file_value_fn fn)
+void config_file_parse(const char *filename, config_file_value_fn fn)
{
static int nesting;
struct strbuf name = STRBUF_INIT;
@@ -95,9 +95,9 @@ int config_file_parse(const char *filename, config_file_value_fn fn)
// An include line calls back into here, so an include cycle would
// recurse until the stack gave out.
if (nesting > MAX_INCLUDE_NESTING)
- return -1;
+ return;
if (!(f = fopen(filename, "r")))
- return -1;
+ return;
nesting++;
while (read_entry(f, &name, &value))
fn(name.buf, value.buf);
@@ -105,5 +105,4 @@ int config_file_parse(const char *filename, config_file_value_fn fn)
fclose(f);
strbuf_release(&name);
strbuf_release(&value);
- return 0;
}
diff --git a/source/config.h b/source/config.h
index ab42e2f..c9ba17d 100644
--- a/source/config.h
+++ b/source/config.h
@@ -11,6 +11,6 @@
typedef void (*config_file_value_fn)(const char *name, const char *value);
-extern int config_file_parse(const char *filename, config_file_value_fn fn);
+extern void config_file_parse(const char *filename, config_file_value_fn fn);
#endif // CGIT_CONFIG_H