diff options
-rw-r--r-- | src/or/directory.c | 2 | ||||
-rw-r--r-- | src/or/dirserv.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 29d40314f..5a2a85602 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -533,7 +533,7 @@ directory_handle_command_get(connection_t *conn, char *headers, return 0; } dlen = dirserv_get_runningrouters(&cp); - if(dlen < 0) { /* we failed to create cp */ + if(!dlen) { /* we failed to create cp */ connection_write_to_buf(answer503, strlen(answer503), conn); return 0; } diff --git a/src/or/dirserv.c b/src/or/dirserv.c index c2d3d8472..5aab93387 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -741,14 +741,14 @@ static int generate_runningrouters(crypto_pk_env_t *private_key) } /** Set *<b>rr</b> to the most recently generated encoded signed - * running-routers list, generating a new one as necessary. */ + * running-routers list, generating a new one as necessary. Return the + * size of the directory on success, and 0 on failure. */ size_t dirserv_get_runningrouters(const char **rr) -/* XXX008 Bug: size_t is unsigned, but we're returning -1 to mean error */ { if (runningrouters_is_dirty) { if(generate_runningrouters(get_identity_key())) { log_fn(LOG_ERR, "Couldn't generate running-routers list?"); - return -1; + return 0; } } *rr = runningrouters_string; |