chiark / gitweb /
tree-wide: drop 'This file is part of systemd' blurb
[elogind.git] / src / login / logind.c
index 1687891d0f31ff8839f62288edd1f96a34246bd8..124fea138105c3bc20dffe02705c9a3c1ee5af1f 100644 (file)
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 /***
-  This file is part of systemd.
-
   Copyright 2011 Lennart Poettering
 ***/
 
@@ -416,14 +414,18 @@ static int parse_fdname(const char *fdname, char **session_id, dev_t *dev) {
 
         if (!streq(parts[0], "session"))
                 return -EINVAL;
+
         id = strdup(parts[1]);
         if (!id)
                 return -ENOMEM;
 
         if (!streq(parts[2], "device"))
                 return -EINVAL;
-        r = safe_atou(parts[3], &major) ||
-            safe_atou(parts[4], &minor);
+
+        r = safe_atou(parts[3], &major);
+        if (r < 0)
+                return r;
+        r = safe_atou(parts[4], &minor);
         if (r < 0)
                 return r;
 
@@ -1294,15 +1296,16 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        /* Always create the directories people can create inotify
-         * watches in. Note that some applications might check for the
-         * existence of /run/systemd/seats/ to determine whether
-         * logind is available, so please always make sure this check
-         * stays in. */
 #if 0 /// elogind can not rely on systemd to help, so we need a bit more effort than this
         mkdir_label("/run/systemd/seats", 0755);
         mkdir_label("/run/systemd/users", 0755);
         mkdir_label("/run/systemd/sessions", 0755);
+        /* Always create the directories people can create inotify watches in. Note that some applications might check
+         * for the existence of /run/systemd/seats/ to determine whether logind is available, so please always make
+         * sure these directories are created early on and unconditionally. */
+        (void) mkdir_label("/run/systemd/seats", 0755);
+        (void) mkdir_label("/run/systemd/users", 0755);
+        (void) mkdir_label("/run/systemd/sessions", 0755);
 
         assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGHUP, SIGTERM, SIGINT, -1) >= 0);