[systemd-commits] 3 commits - man/systemd.timer.xml src/backlight src/libsystemd-network

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Mon Apr 7 19:18:16 PDT 2014


 man/systemd.timer.xml                     |   26 ++++++++++++--------------
 src/backlight/backlight.c                 |   29 +++++++++++++++++++----------
 src/libsystemd-network/test-dhcp-client.c |   17 ++++++-----------
 3 files changed, 37 insertions(+), 35 deletions(-)

New commits:
commit de41590a9bb370de92e4a1ed933bc6e38abb6787
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Apr 7 20:58:37 2014 -0400

    man: reword Persistent= description
    
    I think it is easier to grok this way.

diff --git a/man/systemd.timer.xml b/man/systemd.timer.xml
index 58eaab0..44f55e0 100644
--- a/man/systemd.timer.xml
+++ b/man/systemd.timer.xml
@@ -255,20 +255,18 @@
                                 <term><varname>Persistent=</varname></term>
 
                                 <listitem><para>Takes a boolean
-                                argument. If true the service unit is
-                                immediately triggered when the timer
-                                unit is activated and the timer
-                                elapsed at least once since the last
-                                time the service unit has been
-                                triggered by the timer unit. The time
-                                when the service unit was last
-                                triggered is stored on disk. This is
-                                useful to catch up for missed timers
-                                when a machine is shutdown temporarily
-                                and then is powered up again. Note
-                                that this setting only has an effect
-                                on timers configured with
-                                <varname>OnCalendar=</varname>.
+                                argument. If true, the time when the
+                                service unit was last triggered is
+                                stored on disk. When the timer is
+                                activated, the service unit is
+                                triggered immediately if it would have
+                                been triggered at least once during
+                                the time when the timer was inactive.
+                                This is useful to catch up on missed
+                                runs of the service when the machine
+                                was off. Note that this setting only
+                                has an effect on timers configured
+                                with <varname>OnCalendar=</varname>.
                                 </para></listitem>
                         </varlistentry>
 

commit c4acff1275e8d3a1c29c9b417b93f6cf6f10e258
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Apr 7 20:58:36 2014 -0400

    test-dhcp-client: style fixes

diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c
index 4420436..a208b0d 100644
--- a/src/libsystemd-network/test-dhcp-client.c
+++ b/src/libsystemd-network/test-dhcp-client.c
@@ -347,8 +347,7 @@ static uint8_t test_addr_acq_ack[] = {
 };
 
 static void test_addr_acq_acquired(sd_dhcp_client *client, int event,
-                                   void *userdata)
-{
+                                   void *userdata) {
         sd_event *e = userdata;
         sd_dhcp_lease *lease;
         struct in_addr addr;
@@ -377,8 +376,7 @@ static void test_addr_acq_acquired(sd_dhcp_client *client, int event,
         sd_event_exit(e, 0);
 }
 
-static int test_addr_acq_recv_request(size_t size, DHCPMessage *request)
-{
+static int test_addr_acq_recv_request(size_t size, DHCPMessage *request) {
         uint16_t udp_check = 0;
         uint8_t *msg_bytes = (uint8_t *)request;
         int res;
@@ -409,8 +407,7 @@ static int test_addr_acq_recv_request(size_t size, DHCPMessage *request)
         return 0;
 };
 
-static int test_addr_acq_recv_discover(size_t size, DHCPMessage *discover)
-{
+static int test_addr_acq_recv_discover(size_t size, DHCPMessage *discover) {
         uint16_t udp_check = 0;
         uint8_t *msg_bytes = (uint8_t *)discover;
         int res;
@@ -437,13 +434,12 @@ static int test_addr_acq_recv_discover(size_t size, DHCPMessage *discover)
         assert_se(res == sizeof(test_addr_acq_offer));
 
         if (verbose)
-                printf("  send DHCP Offer\n");
+                printf("  sent DHCP Offer\n");
 
         return 0;
 }
 
-static void test_addr_acq(sd_event *e)
-{
+static void test_addr_acq(sd_event *e) {
         usec_t time_now = now(CLOCK_MONOTONIC);
         sd_dhcp_client *client;
         int res, r;
@@ -488,8 +484,7 @@ static void test_addr_acq(sd_event *e)
         xid = 0;
 }
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
         sd_event *e;
 
         assert_se(sd_event_new(&e) >= 0);

commit 938d2699d2e818bd996614e89ea3d668200ad2a8
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Mon Apr 7 20:57:22 2014 -0400

    backlight: unify error messages

diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index ce0385b..754a646 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -24,6 +24,7 @@
 #include "fileio.h"
 #include "libudev.h"
 #include "udev-util.h"
+#include "def.h"
 
 static struct udev_device *find_pci_or_platform_parent(struct udev_device *device) {
         struct udev_device *parent;
@@ -50,7 +51,7 @@ static struct udev_device *find_pci_or_platform_parent(struct udev_device *devic
                 if (!c)
                         return NULL;
 
-                c += strspn(c, "0123456789");
+                c += strspn(c, DIGITS);
                 if (*c == '-') {
                         /* A connector DRM device, let's ignore all but LVDS and eDP! */
 
@@ -67,7 +68,8 @@ static struct udev_device *find_pci_or_platform_parent(struct udev_device *devic
                         unsigned long class = 0;
 
                         if (safe_atolu(value, &class) < 0) {
-                                log_warning("Cannot parse PCI class %s of device %s:%s.", value, subsystem, sysname);
+                                log_warning("Cannot parse PCI class %s of device %s:%s.",
+                                            value, subsystem, sysname);
                                 return NULL;
                         }
 
@@ -175,7 +177,9 @@ static bool validate_device(struct udev *udev, struct udev_device *device) {
                 if (same_device(parent, other_parent)) {
                         /* Both have the same PCI parent, that means
                          * we are out. */
-                        log_debug("Skipping backlight device %s, since backlight device %s is on same PCI device and, takes precedence.", udev_device_get_sysname(device), udev_device_get_sysname(other));
+                        log_debug("Skipping backlight device %s, since device %s is on same PCI device and takes precedence.",
+                                  udev_device_get_sysname(device),
+                                  udev_device_get_sysname(other));
                         return false;
                 }
 
@@ -184,7 +188,9 @@ static bool validate_device(struct udev *udev, struct udev_device *device) {
                         /* The other is connected to the platform bus
                          * and we are a PCI device, that also means we
                          * are out. */
-                        log_debug("Skipping backlight device %s, since backlight device %s is a platform device and takes precedence.", udev_device_get_sysname(device), udev_device_get_sysname(other));
+                        log_debug("Skipping backlight device %s, since device %s is a platform device and takes precedence.",
+                                  udev_device_get_sysname(device),
+                                  udev_device_get_sysname(other));
                         return false;
                 }
         }
@@ -199,13 +205,14 @@ static unsigned get_max_brightness(struct udev_device *device) {
 
         max_brightness_str = udev_device_get_sysattr_value(device, "max_brightness");
         if (!max_brightness_str) {
-                log_warning("Failed to read max_brightness attribute");
+                log_warning("Failed to read 'max_brightness' attribute");
                 return 0;
         }
 
         r = safe_atou(max_brightness_str, &max_brightness);
         if (r < 0) {
-                log_warning("Failed to parse max_brightness \"%s\": %s", max_brightness_str, strerror(-r));
+                log_warning("Failed to parse 'max_brightness' \"%s\": %s",
+                            max_brightness_str, strerror(-r));
                 return 0;
         }
 
@@ -262,7 +269,8 @@ int main(int argc, char *argv[]) {
 
         r = mkdir_p("/var/lib/systemd/backlight", 0755);
         if (r < 0) {
-                log_error("Failed to create backlight directory: %s", strerror(-r));
+                log_error("Failed to create backlight directory /var/lib/systemd/backlight: %s",
+                          strerror(-r));
                 return EXIT_FAILURE;
         }
 
@@ -274,7 +282,7 @@ int main(int argc, char *argv[]) {
 
         sysname = strchr(argv[2], ':');
         if (!sysname) {
-                log_error("Requires pair of subsystem and sysname for specifying backlight device.");
+                log_error("Requires a subsystem and sysname pair specifying a backlight device.");
                 return EXIT_FAILURE;
         }
 
@@ -368,7 +376,8 @@ int main(int argc, char *argv[]) {
 
                 r = udev_device_set_sysattr_value(device, "brightness", value);
                 if (r < 0) {
-                        log_error("Failed to write system attribute: %s", strerror(-r));
+                        log_error("Failed to write system 'brightness' attribute: %s",
+                                  strerror(-r));
                         return EXIT_FAILURE;
                 }
 
@@ -382,7 +391,7 @@ int main(int argc, char *argv[]) {
 
                 value = udev_device_get_sysattr_value(device, "brightness");
                 if (!value) {
-                        log_error("Failed to read system attribute");
+                        log_error("Failed to read system 'brightness' attribute");
                         return EXIT_FAILURE;
                 }
 



More information about the systemd-commits mailing list