[systemd-commits] 2 commits - src/systemctl src/udev

Lennart Poettering lennart at kemper.freedesktop.org
Fri Nov 8 00:20:22 CET 2013


 src/systemctl/systemctl.c   |    2 +-
 src/udev/net/ethtool-util.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c6581cc14f2d36b49c72542220a7ed9d33bb8944
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Wed Nov 6 11:18:02 2013 +0100

    systemctl: return r instead of always returning 0

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index ad9d125..631cd3d 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1365,7 +1365,7 @@ static int list_jobs(DBusConnection *bus, char **args) {
         }
         free(jobs);
 
-        return 0;
+        return r;
 }
 
 static int cancel_job(DBusConnection *bus, char **args) {

commit 0a2c2294265d1d4552af3e7a92df0d4560deb818
Author: Michal Sekletar <msekleta at redhat.com>
Date:   Wed Nov 6 11:18:01 2013 +0100

    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.

diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c
index 68ddd25..c644f91 100644
--- a/src/udev/net/ethtool-util.c
+++ b/src/udev/net/ethtool-util.c
@@ -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)



More information about the systemd-commits mailing list