summaryrefslogtreecommitdiffstats
path: root/src/socket-proxy/socket-proxyd.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-06-05 15:53:44 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-06-24 10:38:15 +0200
commit80ce54adaf040dc1bcaf755fbfc2431ab0a4bc82 (patch)
tree706af4afdfa91c7ee9a4c6ef76c35bd8523c470a /src/socket-proxy/socket-proxyd.c
parentbasic/hashmap,set: propagate allocation location info in _copy() (diff)
downloadsystemd-80ce54adaf040dc1bcaf755fbfc2431ab0a4bc82.tar.xz
systemd-80ce54adaf040dc1bcaf755fbfc2431ab0a4bc82.zip
socket-proxy: use structured initialization in one place
Diffstat (limited to 'src/socket-proxy/socket-proxyd.c')
-rw-r--r--src/socket-proxy/socket-proxyd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c
index 3b7c5799c8..b461aead60 100644
--- a/src/socket-proxy/socket-proxyd.c
+++ b/src/socket-proxy/socket-proxyd.c
@@ -480,17 +480,19 @@ static int add_connection_socket(Context *context, int fd) {
log_warning_errno(r, "Unable to disable idle timer, continuing: %m");
}
- c = new0(Connection, 1);
+ c = new(Connection, 1);
if (!c) {
log_oom();
return 0;
}
- c->context = context;
- c->server_fd = fd;
- c->client_fd = -1;
- c->server_to_client_buffer[0] = c->server_to_client_buffer[1] = -1;
- c->client_to_server_buffer[0] = c->client_to_server_buffer[1] = -1;
+ *c = (Connection) {
+ .context = context,
+ .server_fd = fd,
+ .client_fd = -1,
+ .server_to_client_buffer = {-1, -1},
+ .client_to_server_buffer = {-1, -1},
+ };
r = set_ensure_put(&context->connections, NULL, c);
if (r < 0) {