Skip to content

Commit 0760602

Browse files
committed
Use client list diretly.
1 parent 1bb443e commit 0760602

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/wdctl_thread.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ wdctl_restart(int afd)
267267
char *sock_name;
268268
s_config *conf = NULL;
269269
struct sockaddr_un sa_un;
270-
t_client *client, *head;
270+
t_client *client;
271271
char *tempstring = NULL;
272272
pid_t pid;
273273
socklen_t len;
@@ -309,9 +309,7 @@ wdctl_restart(int afd)
309309

310310
/* The child is connected. Send them over the socket the existing clients */
311311
LOCK_CLIENT_LIST();
312-
client_list_dup(&head);
313-
UNLOCK_CLIENT_LIST();
314-
client = head;
312+
client = client_get_first_client();
315313
while (client) {
316314
/* Send this client */
317315
safe_asprintf(&tempstring,
@@ -323,7 +321,7 @@ wdctl_restart(int afd)
323321
free(tempstring);
324322
client = client->next;
325323
}
326-
client_list_destroy(head);
324+
UNLOCK_CLIENT_LIST();
327325

328326
close(fd);
329327

0 commit comments

Comments
 (0)