summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-12-16 12:36:29 +0100
committerantirez <antirez@gmail.com>2015-12-17 09:51:48 +0100
commitef92f90d34af82e8252a18a01d5a25a97636edb9 (patch)
tree6bf45a3d3ad9a5fa91e7ebd5180947e31eedb039
parent4fee39033507bb8719f3ed0be1586c40e684ce15 (diff)
downloadredis-ef92f90d34af82e8252a18a01d5a25a97636edb9.tar.gz
Suppress harmless warnings.
-rw-r--r--src/cluster.c2
-rw-r--r--src/debug.c4
-rw-r--r--src/scripting.c6
3 files changed, 8 insertions, 4 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 6df1e3aa3..6fb2f3dc9 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -4743,7 +4743,7 @@ try_again:
/* Read the RESTORE replies. */
int error_from_target = 0;
int del_idx = 1; /* Index of the key argument for the replicated DEL op. */
- robj **newargv;
+ robj **newargv = NULL;
if (!copy) newargv = zmalloc(sizeof(robj*)*(num_keys+1));
diff --git a/src/debug.c b/src/debug.c
index f7d7ed15c..0c81a8711 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -776,10 +776,10 @@ void logStackTrace(ucontext_t *uc) {
if (getMcontextEip(uc) != NULL) {
char *msg1 = "EIP:\n";
char *msg2 = "\nBacktrace:\n";
- write(fd,msg1,strlen(msg1));
+ if (write(fd,msg1,strlen(msg1)) == -1) {/* Avoid warning. */};
trace[0] = getMcontextEip(uc);
backtrace_symbols_fd(trace, 1, fd);
- write(fd,msg2,strlen(msg2));
+ if (write(fd,msg2,strlen(msg2)) == -1) {/* Avoid warning. */};
}
/* Write symbols to log file */
diff --git a/src/scripting.c b/src/scripting.c
index 084e1e3c6..7d2d484bd 100644
--- a/src/scripting.c
+++ b/src/scripting.c
@@ -1566,7 +1566,11 @@ void ldbSendLogs(void) {
proto = sdscatlen(proto,"\r\n",2);
listDelNode(ldb.logs,ln);
}
- write(ldb.fd,proto,sdslen(proto));
+ if (write(ldb.fd,proto,sdslen(proto)) == -1) {
+ /* Avoid warning. We don't check the return value of write()
+ * since the next read() will catch the I/O error and will
+ * close the debugging session. */
+ }
sdsfree(proto);
}