1
0
Fork 0
mirror of https://passt.top/passt synced 2025-07-06 20:18:43 +02:00

cppcheck: Reduce scope of some variables

Minor style improvement suggested by cppcheck.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2022-09-28 14:33:19 +10:00 committed by Stefano Brivio
parent 68ef4931cb
commit eb5e123038
3 changed files with 7 additions and 5 deletions

5
tap.c
View file

@ -782,12 +782,12 @@ restart:
*/
static void tap_sock_unix_init(struct ctx *c)
{
int fd = socket(AF_UNIX, SOCK_STREAM, 0), ex;
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
struct epoll_event ev = { 0 };
struct sockaddr_un addr = {
.sun_family = AF_UNIX,
};
int i, ret;
int i;
if (fd < 0) {
perror("UNIX socket");
@ -802,6 +802,7 @@ static void tap_sock_unix_init(struct ctx *c)
for (i = 1; i < UNIX_SOCK_MAX; i++) {
char *path = addr.sun_path;
int ex, ret;
if (*c->sock_path)
memcpy(path, c->sock_path, UNIX_PATH_MAX);