summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-19 23:29:45 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-19 23:29:45 +0000
commit42c4670e27fe5bdc694875cddedc5151fe8c5244 (patch)
tree56968be60690d89f055663a65a2d67819f43eb89 /src/or/config.c
parent319c0d89337312aa553a21c39dbba8eafd385e53 (diff)
downloadtor-42c4670e27fe5bdc694875cddedc5151fe8c5244.tar.gz
tor-42c4670e27fe5bdc694875cddedc5151fe8c5244.zip
r18230@catbus: nickm | 2008-02-19 18:29:43 -0500
Add a few asserts to catch possible errors found by veracode. svn:r13598
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 36dc9dfeda..5781682c12 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -4753,7 +4753,10 @@ or_state_load(void)
log_warn(LD_BUG, "Unable to parse state in \"%s\". Moving it aside "
"to \"%s\". This could be a bug in Tor; please tell "
"the developers.", fname, fname2);
- (int)rename(fname, fname2);
+ if (rename(fname, fname2) < 0) {
+ log_warn(LD_BUG, "Weirdly, I couldn't even mode the state aside. The "
+ "OS gave an error of %s", strerror(errno));
+ }
}
tor_free(fname2);
tor_free(contents);