commit a61d116425ee9a14ac2f41b48e0c57f95bc7587d
parent 2db720d7babdf7233c369d817dec26ca303f8cff
Author: Kyle Milz <kyle@getaddrinfo.net>
Date: Thu, 24 Mar 2016 22:11:03 -0600
lib: only warn when connecting to server fails
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/runtime.c b/lib/runtime.c
@@ -52,20 +52,20 @@ control_thread(void *arg)
/* There was an error getting the env var, use the default */
viewer_sock = "/tmp/scv_viewer.socket";
- /* Connect the socket to the server which should already be running */
+ /* Connect the socket to the server */
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, viewer_sock, sizeof(addr.sun_path) - 1);
-
- if (connect(fd, (struct sockaddr *)&addr, sizeof(addr))) {
- err(1, "connect");
+ if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
+ warn("connect");
+ pthread_exit(NULL);
}
- /* Send static information firsrt. */
+ /* Send static information first. */
send_metadata(fd);
- /* Then synchronously send execution data */
while (1) {
+ /* Synchronously send execution data */
send_execution_data(fd);
xread(fd, &response, 1);
}