diff options
author | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-04-13 00:10:21 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@microsoft.com> | 2021-04-14 13:25:06 +0200 |
commit | c2b2df604b845b4e1697d0911935e6644323c5a6 (patch) | |
tree | 010d290588b55b7ed97f9e3066f56f9a9d08d77d /src/network/netdev | |
parent | meson: build tests with -Wno-maybe-uninitialized if -O2/-flto are used (diff) | |
download | systemd-c2b2df604b845b4e1697d0911935e6644323c5a6.tar.xz systemd-c2b2df604b845b4e1697d0911935e6644323c5a6.zip |
tree-wide: avoid uninitialized warning on _cleanup_ variables
With some versions of the compiler, the _cleanup_ attr makes it think
the variable might be freed/closed when uninitialized, even though it
cannot happen. The added cost is small enough to be worth the benefit,
and optimized builds will help reduce it even further.
Diffstat (limited to 'src/network/netdev')
-rw-r--r-- | src/network/netdev/tuntap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/netdev/tuntap.c b/src/network/netdev/tuntap.c index d9d654495e..0e13c4f88a 100644 --- a/src/network/netdev/tuntap.c +++ b/src/network/netdev/tuntap.c @@ -46,7 +46,7 @@ static int netdev_fill_tuntap_message(NetDev *netdev, struct ifreq *ifr) { } static int netdev_tuntap_add(NetDev *netdev, struct ifreq *ifr) { - _cleanup_close_ int fd; + _cleanup_close_ int fd = -1; TunTap *t = NULL; const char *user; const char *group; |