[systemd-commits] 2 commits - src/load-fragment.c src/logind.h src/logind-seat.c src/unit-name.c

Lennart Poettering lennart at kemper.freedesktop.org
Mon Jun 27 17:53:56 PDT 2011


 src/load-fragment.c |   11 +++++++----
 src/logind-seat.c   |    2 +-
 src/logind.h        |    3 +--
 src/unit-name.c     |    7 ++++---
 4 files changed, 13 insertions(+), 10 deletions(-)

New commits:
commit e7886786a6fec22fa770eb1554781d5f82c4b349
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 28 02:53:49 2011 +0200

    logind: properly preallocate configured auto VTs

diff --git a/src/logind-seat.c b/src/logind-seat.c
index df91cd0..bc695fe 100644
--- a/src/logind-seat.c
+++ b/src/logind-seat.c
@@ -199,7 +199,7 @@ static int seat_preallocate_vts(Seat *s) {
         if (!seat_is_vtconsole(s))
                 return 0;
 
-        for (i = 1; i < s->manager->n_autovts; i++) {
+        for (i = 1; i <= s->manager->n_autovts; i++) {
                 int q;
 
                 q = vt_allocate(i);

commit 15e11d81e7c26439f583e1cf67ac3c712430a79e
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 28 02:53:15 2011 +0200

    unit: when loading symlinked template units, properly add all names on the way to the unit

diff --git a/src/load-fragment.c b/src/load-fragment.c
index 56eaed9..352db6b 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -1661,13 +1661,16 @@ static int open_follow(char **filename, FILE **_f, Set *names, char **_final) {
                  * unit name. */
                 name = file_name_from_path(*filename);
 
-                if (unit_name_is_valid(name, false)) {
-                        if (!(id = set_get(names, name))) {
+                if (unit_name_is_valid(name, true)) {
 
-                                if (!(id = strdup(name)))
+                        id = set_get(names, name);
+                        if (!id) {
+                                id = strdup(name);
+                                if (!id)
                                         return -ENOMEM;
 
-                                if ((r = set_put(names, id)) < 0) {
+                                r = set_put(names, id);
+                                if (r < 0) {
                                         free(id);
                                         return r;
                                 }
diff --git a/src/logind.h b/src/logind.h
index be8bb1d..18dbe11 100644
--- a/src/logind.h
+++ b/src/logind.h
@@ -37,6 +37,7 @@
  * recreate VTs when disallocated
  * spawn user systemd
  * direct client API
+ * add configuration file
  * D-Bus method: AttachDevices(seat, devices[]);
  * D-Bus method: SetLinger(user, bool b);
  *
@@ -124,8 +125,6 @@ void manager_gc(Manager *m);
 
 int manager_get_idle_hint(Manager *m, dual_timestamp *t);
 
-bool x11_display_is_local(const char *display);
-
 extern const DBusObjectPathVTable bus_manager_vtable;
 
 DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *message, void *userdata);
diff --git a/src/unit-name.c b/src/unit-name.c
index be4e73e..6d45576 100644
--- a/src/unit-name.c
+++ b/src/unit-name.c
@@ -272,9 +272,10 @@ char *unit_name_unescape(const char *f) {
                 else if (*f == '\\') {
                         int a, b;
 
-                        if (f[1] != 'x' || (a = unhexchar(f[2])) < 0 ||
-					(b = unhexchar(f[3])) < 0) {
-				/* Invalid escape code, let's take it literal then */
+                        if (f[1] != 'x' ||
+                            (a = unhexchar(f[2])) < 0 ||
+                            (b = unhexchar(f[3])) < 0) {
+                                /* Invalid escape code, let's take it literal then */
                                 *(t++) = '\\';
                         } else {
                                 *(t++) = (char) ((a << 4) | b);



More information about the systemd-commits mailing list