[systemd-commits] 4 commits - fixme src/log.c src/mount.c src/sd-daemon.c

Lennart Poettering lennart at kemper.freedesktop.org
Thu May 20 18:34:12 PDT 2010


 fixme           |    6 ++++--
 src/log.c       |   56 +++++++++++++++++++++++++++++++++++++-------------------
 src/mount.c     |    7 +++++--
 src/sd-daemon.c |    2 +-
 4 files changed, 47 insertions(+), 24 deletions(-)

New commits:
commit dde770cfc6a287772a936be58b73adf9a6c334f5
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 21 03:34:04 2010 +0200

    sd-daemon: fix listening socket verification

diff --git a/src/sd-daemon.c b/src/sd-daemon.c
index 62936ec..ad2bfa8 100644
--- a/src/sd-daemon.c
+++ b/src/sd-daemon.c
@@ -169,7 +169,7 @@ int sd_is_socket(int fd, int type, int listening) {
                 if (l != sizeof(accepting))
                         return -EINVAL;
 
-                if (!accepting == !listening)
+                if (!accepting != !listening)
                         return 0;
         }
 
commit 19b160fae970b720f3498a8dc247c5f04c7cf16a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 21 03:32:58 2010 +0200

    mount: consider a mount successful if /bin/mount returned successfully but /proc/self/mountinfo didn't notify us yet

diff --git a/src/mount.c b/src/mount.c
index 3b16080..01fc2df 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -936,7 +936,7 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) {
         case MOUNT_REMOUNTING_SIGKILL:
         case MOUNT_REMOUNTING_SIGTERM:
 
-                if (success && m->from_proc_self_mountinfo)
+                if (success)
                         mount_enter_mounted(m, true);
                 else if (m->from_proc_self_mountinfo)
                         mount_enter_mounted(m, false);
commit 8cbef76075910864ed31879c9fb193c127adc20d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 21 03:32:21 2010 +0200

    mount: refuse mount units that have not been loaded from any source

diff --git a/src/mount.c b/src/mount.c
index 921984c..3b16080 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -267,9 +267,12 @@ static int mount_verify(Mount *m) {
         char *e;
         assert(m);
 
-        if (UNIT(m)->meta.load_state != UNIT_LOADED)
+        if (m->meta.load_state != UNIT_LOADED)
                 return 0;
 
+        if (!m->from_etc_fstab && !m->from_fragment && !m->from_proc_self_mountinfo)
+                return -ENOENT;
+
         if (!(e = unit_name_from_path(m->where, ".mount")))
                 return -ENOMEM;
 
commit 9726b29e9811d12c0800a53f0a34dc26fe9b915c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 21 03:31:49 2010 +0200

    log: handle multi-line log messages properly

diff --git a/fixme b/fixme
index 0c04ab8..22c5cc3 100644
--- a/fixme
+++ b/fixme
@@ -46,8 +46,9 @@
 
    - uuidd    DONE
    - nscd     DONE
+   - dbus     DONE
    - rpcbind (/var/run/rpcbind.sock!)
-   - dbus
+   - avahi-daemon (/var/run/avahi-daemon/socket)
    - rsyslog
    - cups
    - ssh      CLASSIC
@@ -55,7 +56,6 @@
    - apache/samba
    - libvirtd (/var/run/libvirt/libvirt-sock-ro)
    - bluetoothd (/var/run/sdp! @/org/bluez/audio!)
-   - avahi-daemon (/var/run/avahi-daemon/socket)
    - distccd
 
 * teach dbus to talk to systemd when autospawning services
@@ -63,6 +63,8 @@
 * Figure out which signal handlers we actually have to reset in the
   forked off child
 
+* loopback-setup is borked for ipv6
+
 Regularly:
 
 * look for close() vs. close_nointr() vs. close_nointr_nofail()
diff --git a/src/log.c b/src/log.c
index 7b4db4c..1343b9d 100644
--- a/src/log.c
+++ b/src/log.c
@@ -312,31 +312,49 @@ static int log_dispatch(
         const char*file,
         int line,
         const char *func,
-        const char *buffer) {
+        char *buffer) {
 
-        int r;
+        int r = 0;
 
-        if (log_target == LOG_TARGET_SYSLOG_OR_KMSG ||
-            log_target == LOG_TARGET_SYSLOG) {
+        do {
+                char *e;
+                int k;
 
-                if ((r = write_to_syslog(level, file, line, func, buffer)) < 0) {
-                        log_close_syslog();
-                        log_open_kmsg();
-                } else if (r > 0)
-                        return r;
-        }
+                buffer += strspn(buffer, NEWLINE);
 
-        if (log_target == LOG_TARGET_SYSLOG_OR_KMSG ||
-            log_target == LOG_TARGET_KMSG) {
+                if (buffer[0] == 0)
+                        break;
 
-                if ((r = write_to_kmsg(level, file, line, func, buffer)) < 0) {
-                        log_close_kmsg();
-                        log_open_console();
-                } else if (r > 0)
-                        return r;
-        }
+                if ((e = strpbrk(buffer, NEWLINE)))
+                        *(e++) = 0;
 
-        return write_to_console(level, file, line, func, buffer);
+                if (log_target == LOG_TARGET_SYSLOG_OR_KMSG ||
+                    log_target == LOG_TARGET_SYSLOG) {
+
+                        if ((r = write_to_syslog(level, file, line, func, buffer)) < 0) {
+                                log_close_syslog();
+                                log_open_kmsg();
+                        } else if (r > 0)
+                                r++;
+                }
+
+                if (log_target == LOG_TARGET_SYSLOG_OR_KMSG ||
+                    log_target == LOG_TARGET_KMSG) {
+
+                        if ((r = write_to_kmsg(level, file, line, func, buffer)) < 0) {
+                                log_close_kmsg();
+                                log_open_console();
+                        } else if (r > 0)
+                                r++;
+                }
+
+                if ((k = write_to_console(level, file, line, func, buffer)) < 0)
+                        return k;
+
+                buffer = e;
+        } while (buffer);
+
+        return r;
 }
 
 int log_meta(


More information about the systemd-commits mailing list