summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-08-06 20:00:16 +0000
committerNick Mathewson <nickm@torproject.org>2004-08-06 20:00:16 +0000
commit3ca2728eb2453633fbc6bd71763b59021e779223 (patch)
tree37b26f8cd73ae5df7ef2f2ede34317ba51d810cd
parentfb3e15b668359d9434461c8987e7f3c4e99d9221 (diff)
downloadtor-3ca2728eb2453633fbc6bd71763b59021e779223.tar.gz
tor-3ca2728eb2453633fbc6bd71763b59021e779223.zip
(size_t)-1 is never < 0; fix an XXXX008 by changing the interface for dirserv_get_runningrouters
svn:r2165
-rw-r--r--src/or/directory.c2
-rw-r--r--src/or/dirserv.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 29d40314f5..5a2a85602e 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 c2d3d8472c..5aab933877 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;