mirror of
https://github.com/systemd/systemd.git
synced 2025-02-14 05:57:40 +03:00
net-util: call ioctl() only if necessary
In case when update of current values is not necessary we still might end up calling ioctl(), because need_update variable is not explicitly initialized.
This commit is contained in:
parent
47c649b5de
commit
0a2c229426
@ -67,7 +67,7 @@ int ethtool_set_speed(int fd, const char *ifname, unsigned int speed, Duplex dup
|
||||
{
|
||||
struct ifreq ifr;
|
||||
struct ethtool_cmd ecmd;
|
||||
bool need_update;
|
||||
bool need_update = false;
|
||||
int r;
|
||||
|
||||
if (speed == 0 && duplex == _DUP_INVALID)
|
||||
@ -120,7 +120,7 @@ int ethtool_set_speed(int fd, const char *ifname, unsigned int speed, Duplex dup
|
||||
int ethtool_set_wol(int fd, const char *ifname, WakeOnLan wol) {
|
||||
struct ifreq ifr;
|
||||
struct ethtool_wolinfo ecmd;
|
||||
bool need_update;
|
||||
bool need_update = false;
|
||||
int r;
|
||||
|
||||
if (wol == _WOL_INVALID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user