[systemd-commits] 3 commits - src/libsystemd-bus src/udev

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Fri Mar 22 20:11:39 PDT 2013


 src/libsystemd-bus/bus-message.h |    4 ++--
 src/libsystemd-bus/sd-bus.c      |    8 +++-----
 src/udev/udevadm-info.c          |    2 +-
 3 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 46512cd959f0a2bbeef3d9a08aa5be408cbf3521
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Fri Mar 22 22:55:05 2013 -0400

    udevadm: place const in the right place
    
    Otherwise clang at least thinks that both consts apply to char.

diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c
index c478214..0028765 100644
--- a/src/udev/udevadm-info.c
+++ b/src/udev/udevadm-info.c
@@ -33,7 +33,7 @@
 
 static bool skip_attribute(const char *name)
 {
-        static const char const *skip[] = {
+        static const char* const skip[] = {
                 "uevent",
                 "dev",
                 "modalias",

commit 9e1fe7c3db6f335a9e1c2fac2fe2b7443076b29b
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Fri Mar 22 22:00:49 2013 -0400

    bus: don't free an unallocated var
    
    Also remove unused variable.

diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index 88f17a2..0acc6b2 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -972,11 +972,10 @@ static int message_make(sd_bus *bus, size_t size, sd_bus_message **m) {
         assert(bus->state == BUS_RUNNING || bus->state == BUS_HELLO);
 
         if (bus->rbuffer_size > size) {
-                b = memdup((const uint8_t*) bus->rbuffer + size, bus->rbuffer_size - size);
-                if (!b) {
-                        free(t);
+                b = memdup((const uint8_t*) bus->rbuffer + size,
+                           bus->rbuffer_size - size);
+                if (!b)
                         return -ENOMEM;
-                }
         }
 
         r = bus_message_from_malloc(bus->rbuffer, size,
@@ -1536,7 +1535,6 @@ int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) {
 }
 
 static int process_timeout(sd_bus *bus) {
-        _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
         struct reply_callback *c;
         usec_t n;
         int r;

commit cb695f05c5bb7d188090b570c22a8231f8e02afe
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Fri Mar 22 21:58:43 2013 -0400

    bus: move attribute to end of structure, so it is not ignored
    
    src/libsystemd-bus/bus-message.h:41:1: warning: attribute 'packed' is ignored, place it after
          "struct" to apply attribute to type declaration [-Wignored-attributes]

diff --git a/src/libsystemd-bus/bus-message.h b/src/libsystemd-bus/bus-message.h
index b21fdf0..1a6c614 100644
--- a/src/libsystemd-bus/bus-message.h
+++ b/src/libsystemd-bus/bus-message.h
@@ -38,7 +38,7 @@ struct bus_container {
         size_t begin;
 };
 
-_packed_ struct bus_header {
+struct bus_header {
         uint8_t endian;
         uint8_t type;
         uint8_t flags;
@@ -46,7 +46,7 @@ _packed_ struct bus_header {
         uint32_t body_size;
         uint32_t serial;
         uint32_t fields_size;
-};
+} _packed_;
 
 struct sd_bus_message {
         unsigned n_ref;



More information about the systemd-commits mailing list