diff --git a/src/common/util.c b/src/common/util.c index a7c1adecba..333344959a 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1075,11 +1075,13 @@ write_str_to_file(const char *fname, const char *str) if (!(file = fdopen(fd, "w"))) { log(LOG_WARN, "Couldn't fdopen %s for writing: %s", tempname, strerror(errno)); - close(fd); return -1; + close(fd); + return -1; } if (fputs(str,file) == EOF) { log(LOG_WARN, "Error writing to %s: %s", tempname, strerror(errno)); - fclose(file); return -1; + fclose(file); + return -1; } fclose(file); if (rename(tempname, fname)) { diff --git a/src/common/util.h b/src/common/util.h index eeaddd994a..6ef0484803 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -77,9 +77,6 @@ char *tor_strndup(const char *s, size_t n); void tor_strlower(char *s); #ifdef UNALIGNED_INT_ACCESS_OK -/* XXX Not actually used yet, but would probably be faster on non-sun - * hardare. - */ #define get_uint16(cp) (*(uint16_t*)(cp)) #define get_uint32(cp) (*(uint32_t*)(cp)) #define set_uint16(cp,v) do { *(uint16_t*)(cp) = (v); } while (0)