File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,7 @@ int main(int argc, char *argv[]) {
15
15
}
16
16
const char * socket_path = argv [1 ];
17
17
int socket_fd = -1 ;
18
- struct sockaddr_un addr ;
19
- memset (& addr , 0 , sizeof (addr ));
18
+ struct sockaddr_un addr = {0 };
20
19
if ((socket_fd = socket (PF_LOCAL , SOCK_STREAM , 0 )) < 0 ) {
21
20
perror ("socket" );
22
21
exit (EXIT_FAILURE );
Original file line number Diff line number Diff line change @@ -315,8 +315,8 @@ static void stop(struct state *state, interface_ref iface) {
315
315
static int socket_bindlisten (const char * socket_path ,
316
316
const char * socket_group ) {
317
317
int fd = -1 ;
318
- struct sockaddr_un addr ;
319
- memset ( & addr , 0 , sizeof ( addr ));
318
+ struct sockaddr_un addr = { 0 } ;
319
+
320
320
unlink (socket_path ); /* avoid EADDRINUSE */
321
321
if ((fd = socket (PF_LOCAL , SOCK_STREAM , 0 )) < 0 ) {
322
322
ERRORN ("socket" );
@@ -371,8 +371,7 @@ int main(int argc, char *argv[]) {
371
371
int rc = 1 , listen_fd = -1 ;
372
372
__block interface_ref iface = NULL ;
373
373
374
- struct state state ;
375
- memset (& state , 0 , sizeof (state ));
374
+ struct state state = {0 };
376
375
377
376
struct cli_options * cliopt = cli_options_parse (argc , argv );
378
377
assert (cliopt != NULL );
You can’t perform that action at this time.
0 commit comments