summaryrefslogtreecommitdiffstats
path: root/src/dabInputZmq.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-12-18 16:32:16 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-12-18 16:32:16 +0100
commit2d07ccc14d3d8e52c115336d5ab88e45de2eef74 (patch)
treee86053790011ac2ac633aad88c0aa29d9a2ad468 /src/dabInputZmq.cpp
parentf008aec73bf108fc4f27c22d89704fb3c9572b97 (diff)
downloaddabmux-2d07ccc14d3d8e52c115336d5ab88e45de2eef74.tar.gz
dabmux-2d07ccc14d3d8e52c115336d5ab88e45de2eef74.tar.bz2
dabmux-2d07ccc14d3d8e52c115336d5ab88e45de2eef74.zip
Fix error handling in zmq readkey
Diffstat (limited to 'src/dabInputZmq.cpp')
-rw-r--r--src/dabInputZmq.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dabInputZmq.cpp b/src/dabInputZmq.cpp
index 5c20baf..e5a1654 100644
--- a/src/dabInputZmq.cpp
+++ b/src/dabInputZmq.cpp
@@ -71,9 +71,10 @@ int readkey(string& keyfile, char* key)
if (fd < 0)
return fd;
int ret = read(fd, key, CURVE_KEYLEN);
- if (ret < 0)
- return ret;
close(fd);
+ if (ret < 0) {
+ return ret;
+ }
/* It needs to be zero-terminated */
key[CURVE_KEYLEN] = '\0';