summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/server.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/src/server.cc b/server/src/server.cc
index 9d52369..6783492 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -95,6 +95,8 @@ static void connection(Pentominos::TCPSocket &socket)
std::string macro = std::string(XML) + "/" + macro_request + ".xml";
int fd = open(macro.c_str(), O_RDONLY);
+ if(fd == -1) return;
+
while((bytes = read(fd, outbuf, sizeof(outbuf))) ) {
socket.write(outbuf, bytes);
}