summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/socket/ingen_socket_server.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/socket/ingen_socket_server.cpp b/src/socket/ingen_socket_server.cpp
index b9bdc19c..5aff7179 100644
--- a/src/socket/ingen_socket_server.cpp
+++ b/src/socket/ingen_socket_server.cpp
@@ -50,8 +50,9 @@ ingen_listen(Ingen::World* world,
if (!unix_sock->bind(unix_uri) || !unix_sock->listen()) {
world->log().error("Failed to create UNIX socket\n");
unix_sock->close();
+ } else {
+ world->log().info(fmt("Listening on socket %1%\n") % unix_uri);
}
- world->log().info(fmt("Listening on socket %1%\n") % unix_uri);
// Bind TCP socket
const int port = world->conf().option("engine-port").get<int32_t>();
@@ -61,8 +62,13 @@ ingen_listen(Ingen::World* world,
if (!net_sock->bind(Raul::URI(ss.str())) || !net_sock->listen()) {
world->log().error("Failed to create TCP socket\n");
net_sock->close();
+ } else {
+ world->log().info(fmt("Listening on TCP port %1%\n") % port);
+ }
+
+ if (unix_sock->fd() == -1 && net_sock->fd() == -1) {
+ return; // No sockets to listen to, exit thread
}
- world->log().info(fmt("Listening on TCP port %1%\n") % port);
struct pollfd pfds[2];
int nfds = 0;