chiark / gitweb /
unit: when loading symlinked template units, properly add all names on the way to...
authorLennart Poettering <lennart@poettering.net>
Tue, 28 Jun 2011 00:53:15 +0000 (02:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 28 Jun 2011 00:53:15 +0000 (02:53 +0200)
src/load-fragment.c
src/logind.h
src/unit-name.c

index 56eaed9ab4de06e7e73701f91608ee513cead51e..352db6b38593a06d565f6ead957bda81d0fe4a7f 100644 (file)
@@ -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;
                                 }
index be8bb1d389a37b033f95cee088835856a5ba0b62..18dbe11a9fed1a0f3a038e097a70186eae93a54b 100644 (file)
@@ -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);
index be4e73edccb0e3ae5561977aea456564626c1d69..6d45576f8546120081dc45c0f035633514c063e3 100644 (file)
@@ -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);