[systemd-commits] 9 commits - autogen.sh configure.ac Makefile.am man/kernel-command-line.xml src/core src/libsystemd-daemon src/login src/systemctl src/test src/udev

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Sun Jul 22 15:08:44 PDT 2012


 Makefile.am                       |   17 +++++++++++++----
 autogen.sh                        |    2 ++
 configure.ac                      |    2 +-
 man/kernel-command-line.xml       |    2 +-
 src/core/load-fragment.c          |    1 -
 src/core/service.c                |    1 -
 src/libsystemd-daemon/sd-daemon.c |    2 --
 src/login/logind-session.c        |    2 +-
 src/systemctl/systemctl.c         |    2 +-
 src/test/test-job-type.c          |    2 +-
 src/udev/collect/collect.c        |    3 ++-
 src/udev/keymap/keymap.c          |    3 ++-
 12 files changed, 24 insertions(+), 15 deletions(-)

New commits:
commit 956b78e8e3636bbf04e264ca96128edc2cbf3626
Author: Jim Meyering <jim at meyering.net>
Date:   Thu Jun 16 08:51:14 2011 +0200

    sd-daemon: remove unnecessary memset calls
    
    There is no point in clearing the bits of a "struct stat" when the very
    next statement just calls stat or fstat to fill in that same memory.
    
    [zj: two more places]

diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 7fcd63a..bbd82b9 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -2287,7 +2287,6 @@ static int load_from_path(Unit *u, const char *path) {
                 goto finish;
         }
 
-        zero(st);
         if (fstat(fileno(f), &st) < 0) {
                 r = -errno;
                 goto finish;
diff --git a/src/core/service.c b/src/core/service.c
index 30598de..1c127bd 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -564,7 +564,6 @@ static int service_load_sysv_path(Service *s, const char *path) {
                 goto finish;
         }
 
-        zero(st);
         if (fstat(fileno(f), &st) < 0) {
                 r = -errno;
                 goto finish;
diff --git a/src/libsystemd-daemon/sd-daemon.c b/src/libsystemd-daemon/sd-daemon.c
index 763e079..863ac75 100644
--- a/src/libsystemd-daemon/sd-daemon.c
+++ b/src/libsystemd-daemon/sd-daemon.c
@@ -152,7 +152,6 @@ _sd_export_ int sd_is_fifo(int fd, const char *path) {
         if (fd < 0)
                 return -EINVAL;
 
-        memset(&st_fd, 0, sizeof(st_fd));
         if (fstat(fd, &st_fd) < 0)
                 return -errno;
 
@@ -162,7 +161,6 @@ _sd_export_ int sd_is_fifo(int fd, const char *path) {
         if (path) {
                 struct stat st_path;
 
-                memset(&st_path, 0, sizeof(st_path));
                 if (stat(path, &st_path) < 0) {
 
                         if (errno == ENOENT || errno == ENOTDIR)

commit 17804d7f0a4002d4f0b8f1dc6e25fcca9381c13e
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jul 22 15:24:25 2012 +0200

    logind: fix operation precedence mix-up
    
    Since + has higher precedence than ?:, and u+b is unlikely to be exactly zero,
    the timestamp would usually be set to IDLE_THRESHOLD_USEC. Fix it by
    returning either 'last activity', or 'last activity+IDLE_THRESHOLD_USEC'.

diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index e438c66..819596d 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -769,7 +769,7 @@ int session_get_idle_hint(Session *s, dual_timestamp *t) {
         b = u + IDLE_THRESHOLD_USEC < n;
 
         if (t)
-                dual_timestamp_from_realtime(t, u + b ? IDLE_THRESHOLD_USEC : 0);
+                dual_timestamp_from_realtime(t, u + b*IDLE_THRESHOLD_USEC);
 
         return b;
 

commit 335c8d5ac1b96c9b2a71e0f9b46a4446aded7396
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jul 22 14:48:52 2012 +0200

    test: correct enum misassignment
    
    CC     src/test/test_job_type-test-job-type.o
    ../src/test/test-job-type.c:40:25: warning: implicit conversion from enumeration type
          'enum UnitType' to different enumeration type 'ServiceType' (aka 'enum ServiceType')
          [-Wconversion]
                    .type = UNIT_SERVICE
                            ^~~~~~~~~~~~

diff --git a/src/test/test-job-type.c b/src/test/test-job-type.c
index a60be24..1066374 100644
--- a/src/test/test-job-type.c
+++ b/src/test/test-job-type.c
@@ -37,7 +37,7 @@ int main(int argc, char*argv[]) {
         /* fake a unit */
         static Service s = {
                 .meta.load_state = UNIT_LOADED,
-                .type = UNIT_SERVICE
+                .type = SERVICE_SIMPLE,
         };
         Unit *u = UNIT(&s);
 

commit d91b8841d7a3ee08aa686852154b08a3e9eb9732
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jul 22 14:42:09 2012 +0200

    collect, keymap, systemctl: use _noreturn_

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index e587cfb..18c8abe 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5641,7 +5641,7 @@ done:
         return 0;
 }
 
-static void halt_now(enum action a) {
+static _noreturn_ void halt_now(enum action a) {
 
        /* Make sure C-A-D is handled by the kernel from this
          * point on... */
diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c
index 7775429..80f464a 100644
--- a/src/udev/collect/collect.c
+++ b/src/udev/collect/collect.c
@@ -33,6 +33,7 @@
 
 #include "libudev.h"
 #include "libudev-private.h"
+#include "macro.h"
 
 #define BUFSIZE                        16
 #define UDEV_ALARM_TIMEOUT        180
@@ -60,7 +61,7 @@ static inline struct _mate *node_to_mate(struct udev_list_node *node)
         return container_of(node, struct _mate, node);
 }
 
-static void sig_alrm(int signo)
+_noreturn_ static void sig_alrm(int signo)
 {
         exit(4);
 }
diff --git a/src/udev/keymap/keymap.c b/src/udev/keymap/keymap.c
index 051aa42..6dc9c2d 100644
--- a/src/udev/keymap/keymap.c
+++ b/src/udev/keymap/keymap.c
@@ -40,6 +40,7 @@ const struct key* lookup_key (const char *str, unsigned int len);
 
 #include "keys-from-name.h"
 #include "keys-to-name.h"
+#include "macro.h"
 #include "util.h"
 
 #define MAX_SCANCODES 1024
@@ -346,7 +347,7 @@ static void interactive(int fd)
         ioctl(fd, EVIOCGRAB, 0);
 }
 
-static void help(int error)
+_noreturn_ static void help(int error)
 {
         const char* h = "Usage: keymap <event device> [<map file>]\n"
                         "       keymap <event device> scancode keyname [...]\n"

commit 97f4e8875088ff34da535864afa0054f24071cd5
Author: Shawn Landden <shawnlandden at gmail.com>
Date:   Fri Jun 22 04:45:29 2012 -0700

    man: typo

diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml
index ae705ee..cfc9b85 100644
--- a/man/kernel-command-line.xml
+++ b/man/kernel-command-line.xml
@@ -264,7 +264,7 @@
 
                                 <listitem>
                                         <para>Load a specific kernel
-                                        boot early at boot. For
+                                        module early at boot. For
                                         details see
                                         <citerefentry><refentrytitle>systemd-modules-load.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
                                 </listitem>

commit bf7410e4a7800da2baef805a0fb475cc6a2145db
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jul 22 23:32:21 2012 +0200

    build-sys: distribute a few more man pages

diff --git a/Makefile.am b/Makefile.am
index bf70381..b31a713 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -538,6 +538,7 @@ MANPAGES_ALIAS = \
 	man/systemd-poweroff.service.8 \
 	man/systemd-reboot.service.8 \
 	man/systemd-kexec.service.8 \
+	man/systemd-fsck.8 \
 	man/systemd-fsck-root.service.8 \
 	man/systemd-ask-password-console.path.8 \
 	man/systemd-ask-password-wall.service.8 \
@@ -604,6 +605,7 @@ man/systemd-shutdown.8: man/systemd-halt.service.8
 man/systemd-poweroff.service.8: man/systemd-halt.service.8
 man/systemd-reboot.service.8: man/systemd-halt.service.8
 man/systemd-kexec.service.8: man/systemd-halt.service.8
+man/systemd-fsck.8: man/systemd-fsck at .service.8
 man/systemd-fsck-root.service.8: man/systemd-fsck at .service.8
 man/systemd-ask-password-console.path.8: man/systemd-ask-password-console.service.8
 man/systemd-ask-password-wall.service.8: man/systemd-ask-password-console.service.8
@@ -1659,7 +1661,13 @@ MANPAGES += \
 	man/systemd-udevd.service.8
 
 MANPAGES_ALIAS += \
-	man/systemd-udevd.8
+	man/systemd-udevd.8 \
+	man/systemd-udevd-control.socket.8 \
+	man/systemd-udevd-kernel.socket.8
+
+man/systemd-udevd.8: man/systemd-udevd.service.8
+man/systemd-udevd-control.socket.8: man/systemd-udevd.service.8
+man/systemd-udevd-kernel.socket.8: man/systemd-udevd.service.8
 
 udev-confdirs:
 	-mkdir -p $(DESTDIR)$(sysconfdir)/udev/rules.d
@@ -3244,7 +3252,6 @@ MANPAGES += \
 	man/systemd-user-sessions.service.8
 
 MANPAGES_ALIAS += \
-	man/systemd-logind.8 \
 	man/sd_login_monitor_unref.3 \
 	man/sd_login_monitor_flush.3 \
 	man/sd_login_monitor_get_fd.3 \
@@ -3252,6 +3259,7 @@ MANPAGES_ALIAS += \
 	man/sd_session_get_uid.3 \
 	man/sd_session_get_seat.3 \
 	man/sd_session_get_service.3 \
+	man/sd_session_get_state.3 \
 	man/sd_session_get_type.3 \
 	man/sd_session_get_class.3 \
 	man/sd_session_get_display.3 \
@@ -3264,6 +3272,7 @@ MANPAGES_ALIAS += \
 	man/sd_seat_can_multi_session.3 \
 	man/sd_get_sessions.3 \
 	man/sd_get_uids.3 \
+	man/systemd-logind.8 \
 	man/systemd-user-sessions.8
 
 man/systemd-logind.8: man/systemd-logind.service.8

commit c87f7103fe38434f0b88df5c2b080c7b558feabf
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sun Jul 22 14:10:51 2012 +0200

    build-sys: hide error message from grep

diff --git a/configure.ac b/configure.ac
index b715a34..cef2539 100644
--- a/configure.ac
+++ b/configure.ac
@@ -509,7 +509,7 @@ if test "z$with_distro" = "z"; then
         if test "$cross_compiling" = yes; then
                 AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
         else
-                with_distro=$($GREP '^ID=' /etc/os-release | $SED 's/ID=//');
+                with_distro=$($GREP '^ID=' /etc/os-release 2>/dev/null | $SED 's/ID=//');
         fi
         if test "z$with_distro" = "z"; then
                 with_distro=other

commit 2fd8b540c939d1dfdea3f42bd04a378035b3e070
Author: Zbyszek Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Wed Jul 18 10:06:18 2012 +0200

    build-sys: fail early in autogen.sh
    
    When intltoolize is not installed, autogen.sh runs without error,
    but configure.ac is borked.
    
    ./configure: line 12001: syntax error near unexpected token `0.40.0'
    ./configure: line 12001: `IT_PROG_INTLTOOL(0.40.0)'

diff --git a/autogen.sh b/autogen.sh
index f9ad5f0..bec43fa 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -15,6 +15,8 @@
 #  You should have received a copy of the GNU Lesser General Public License
 #  along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
+set -e
+
 if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
         cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
         chmod +x .git/hooks/pre-commit && \

commit a804b788a89a881260c4d4c7eccc1677f27c54af
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Wed Jul 18 16:14:24 2012 +0200

    build-sys: fix (again) index generation in subdir
    
    make-man-index.py doesn't care about .html files, only .xml files, so
    the source list was wrong. Also, $(XML_FILES) are specified without
    prefix, so compilation in sepearate build-dir was broken:
    
      GEN    man/index.html
    Traceback (most recent call last):
      File "../make-man-index.py", line 24, in <module>
        t = parse(p)
      File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1183, in parse
        tree.parse(source, parser)
      File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 647, in parse
        source = open(source, "rb")
    IOError: [Errno 2] No such file or directory: 'man/systemd.xml'

diff --git a/Makefile.am b/Makefile.am
index 6f88642..bf70381 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -673,9 +673,9 @@ noinst_DATA += \
 CLEANFILES += \
 	man/index.html
 
-$(builddir)/man/index.html: $(XML_FILES:.xml=.html) $(top_srcdir)/make-man-index.py
+man/index.html: make-man-index.py $(XML_FILES)
 	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
-	$(PYTHON) $(top_srcdir)/make-man-index.py $(XML_FILES) > $@
+	$(PYTHON) $^ > $@
 
 EXTRA_DIST += \
 	man/index.html



More information about the systemd-commits mailing list