summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-08-17 13:49:52 -0400
committerNick Mathewson <nickm@torproject.org>2012-08-17 13:49:52 -0400
commit4c8fcba86c35bd8e2cfde4c65f394c7837638ff0 (patch)
tree92c76044dae96a72fb0cb2976fe41d3f8bec9d62
parent6a33c33a12f3af414e97b91d5718ea16f2d26673 (diff)
downloadtor-4c8fcba86c35bd8e2cfde4c65f394c7837638ff0.tar.gz
tor-4c8fcba86c35bd8e2cfde4c65f394c7837638ff0.zip
Fix more warnings from openbsd_malloc
Apparently, (void)writev is not enough to suppress the "you are ignoring the return value!" warnings on Linux. Instead, remove the whole warning/error logic when compiling openbsd_malloc for Tor: we can't use it.
-rw-r--r--src/common/OpenBSD_malloc_Linux.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/common/OpenBSD_malloc_Linux.c b/src/common/OpenBSD_malloc_Linux.c
index 39c8f8b762..da82729811 100644
--- a/src/common/OpenBSD_malloc_Linux.c
+++ b/src/common/OpenBSD_malloc_Linux.c
@@ -450,6 +450,7 @@ extern char *__progname;
static void
wrterror(const char *p)
{
+#ifndef BUILDING_FOR_TOR
const char *q = " error: ";
struct iovec iov[5];
@@ -463,8 +464,10 @@ wrterror(const char *p)
iov[3].iov_len = strlen(p);
iov[4].iov_base = (char*)"\n";
iov[4].iov_len = 1;
- (void) writev(STDERR_FILENO, iov, 5);
-
+ writev(STDERR_FILENO, iov, 5);
+#else
+ (void)p;
+#endif
suicide = 1;
#ifdef MALLOC_STATS
if (malloc_stats)
@@ -478,14 +481,17 @@ wrterror(const char *p)
static void
wrtwarning(const char *p)
{
+#ifndef BUILDING_FOR_TOR
const char *q = " warning: ";
struct iovec iov[5];
+#endif
if (malloc_abort)
wrterror(p);
else if (malloc_silent)
return;
+#ifndef BUILDING_FOR_TOR
iov[0].iov_base = __progname;
iov[0].iov_len = strlen(__progname);
iov[1].iov_base = (char*)malloc_func;
@@ -498,6 +504,9 @@ wrtwarning(const char *p)
iov[4].iov_len = 1;
(void) writev(STDERR_FILENO, iov, 5);
+#else
+ (void)p;
+#endif
}
#ifdef MALLOC_STATS