changeset 22995:80ba6e7551ee

lib-master: ipc-client: Cleanup - avoid extra return in the function Simplifies the following commit.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 05 Jul 2018 14:41:38 +0300
parents ed789b38da96
children fd4e4582ff6c
files src/lib-master/ipc-client.c
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-master/ipc-client.c	Thu Jul 05 14:38:51 2018 +0300
+++ b/src/lib-master/ipc-client.c	Thu Jul 05 14:41:38 2018 +0300
@@ -178,12 +178,11 @@
 			client->to_failed = timeout_add_short(0,
 				ipc_client_cmd_connect_failed, client);
 		}
-		return;
+	} else {
+		iov[0].iov_base = cmd;
+		iov[0].iov_len = strlen(cmd);
+		iov[1].iov_base = "\n";
+		iov[1].iov_len = 1;
+		o_stream_nsendv(client->output, iov, N_ELEMENTS(iov));
 	}
-
-	iov[0].iov_base = cmd;
-	iov[0].iov_len = strlen(cmd);
-	iov[1].iov_base = "\n";
-	iov[1].iov_len = 1;
-	o_stream_nsendv(client->output, iov, N_ELEMENTS(iov));
 }