diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2020-03-14 17:52:06 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2020-03-15 14:30:58 +0100 |
commit | 51d8f69fb152ae5a47151c2f132fd4263ec3d144 (patch) | |
tree | 67ef7b137bc00fdbb93774aa8ccbbbb39975ace0 /src/ipcpd/broadcast/enroll.c | |
parent | b977090a7692acada4b81677e88c5a5e60a153c3 (diff) | |
download | ouroboros-51d8f69fb152ae5a47151c2f132fd4263ec3d144.tar.gz ouroboros-51d8f69fb152ae5a47151c2f132fd4263ec3d144.zip |
lib: Return number of written bytes on flow_write0.17.0
This is more in line with the write() system call and prepares for
partial writes. Partial writes are disabled by default (and not yet
implemented).
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/broadcast/enroll.c')
-rw-r--r-- | src/ipcpd/broadcast/enroll.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ipcpd/broadcast/enroll.c b/src/ipcpd/broadcast/enroll.c index 36b82af1..511892b7 100644 --- a/src/ipcpd/broadcast/enroll.c +++ b/src/ipcpd/broadcast/enroll.c @@ -87,7 +87,7 @@ static int send_rcv_enroll_msg(int fd) clock_gettime(CLOCK_REALTIME, &t0); - if (flow_write(fd, buf, len)) { + if (flow_write(fd, buf, len) < 0) { log_dbg("Failed to send request message."); return -1; } @@ -222,7 +222,7 @@ static void * enroll_handle(void * o) log_dbg("Sending enrollment info (%zd bytes).", len); - if (flow_write(conn.flow_info.fd, reply, len)) { + if (flow_write(conn.flow_info.fd, reply, len) < 0) { log_err("Failed respond to enrollment request."); connmgr_dealloc(COMPID_ENROLL, &conn); free(reply); @@ -296,7 +296,7 @@ int enroll_done(struct conn * conn, enroll_msg__pack(&msg, buf); - if (flow_write(conn->flow_info.fd, buf, len)) { + if (flow_write(conn->flow_info.fd, buf, len) < 0) { log_dbg("Failed to send acknowledgment."); return -1; } |