diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2022-09-28 14:33:19 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-09-29 12:22:01 +0200 |
commit | eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6 (patch) | |
tree | a128ae0781a1f43d38396285fa080cdbd3d02ff7 /tap.c | |
parent | 68ef4931cb8bcbc53c0d2b6078946d836da7b5d9 (diff) | |
download | passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar.gz passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar.bz2 passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar.lz passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar.xz passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar.zst passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.zip |
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>
Diffstat (limited to 'tap.c')
-rw-r--r-- | tap.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |