summaryrefslogtreecommitdiff
path: root/server/src/journal_commit.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/journal_commit.cc')
-rw-r--r--server/src/journal_commit.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/server/src/journal_commit.cc b/server/src/journal_commit.cc
index 336ac7a..4b79a65 100644
--- a/server/src/journal_commit.cc
+++ b/server/src/journal_commit.cc
@@ -44,7 +44,7 @@
//#define NO_NETWORK
-static int mwrite(int sock, char *fmt, ...)
+static int mwrite(int sock, const char *fmt, ...)
{
int l = 0;
va_list args;
@@ -56,7 +56,9 @@ static int mwrite(int sock, char *fmt, ...)
l = vsnprintf(buffer, 64*1024, fmt, args);
va_end(args);
- write(sock, buffer, l);
+ if(write(sock, buffer, l) != l) {
+ fprintf(stderr, "write did not write all the bytes in the buffer.\n");
+ }
free(buffer);
@@ -115,7 +117,9 @@ int journal_commit(const char *cpr, const char *user,
mwrite(sock, "\r\n");
// send body
- write(sock, buf, size);
+ if(write(sock, buf, size) != (ssize_t)size) {
+ fprintf(stderr, "write did not write all the bytes in the buffer.\n");
+ }
// close socket
close(sock);