]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/main.c
tree-wide: replace strjoin() with path_join()
[thirdparty/systemd.git] / src / core / main.c
index b33ea1b5b5286335ac04de7c6f2178ab1a74e303..a94e6caf858a0d4048be64b6c6ef696750c7b367 100644 (file)
@@ -328,7 +328,7 @@ static int parse_confirm_spawn(const char *value, char **console) {
         else if (is_path(value)) /* on with fully qualified path */
                 s = strdup(value);
         else /* on with only a tty file name, not a fully qualified path */
-                s = strjoin("/dev/", value);
+                s = path_join("/dev", value);
         if (!s)
                 return -ENOMEM;
 
@@ -1245,9 +1245,9 @@ static void bump_file_max_and_nr_open(void) {
 #endif
 
 #if BUMP_PROC_SYS_FS_FILE_MAX
-        /* I so wanted to use STRINGIFY(ULONG_MAX) here, but alas we can't as glibc/gcc define that as
-         * "(0x7fffffffffffffffL * 2UL + 1UL)". Seriously. ðŸ˜¢ */
-        if (asprintf(&t, "%lu\n", ULONG_MAX) < 0) {
+        /* The maximum the kernel allows for this since 5.2 is LONG_MAX, use that. (Previously thing where
+         * different but the operation would fail silently.) */
+        if (asprintf(&t, "%li\n", LONG_MAX) < 0) {
                 log_oom();
                 return;
         }