]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/rc-local-generator/rc-local-generator.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / rc-local-generator / rc-local-generator.c
index 8e5cf0908c14270a4000abd626fad105d75ffe29..196947ca5156135fa637a17fa75c6af673d92b81 100644 (file)
@@ -1,5 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
 #include "string-util.h"
 #include "util.h"
 
-#ifndef RC_LOCAL_SCRIPT_PATH_START
-#define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.d/rc.local"
-#endif
-
-#ifndef RC_LOCAL_SCRIPT_PATH_STOP
-#define RC_LOCAL_SCRIPT_PATH_STOP "/sbin/halt.local"
-#endif
-
-const char *arg_dest = "/tmp";
+static const char *arg_dest = "/tmp";
 
 static int add_symlink(const char *service, const char *where) {
         _cleanup_free_ char *from = NULL, *to = NULL;
@@ -47,11 +38,11 @@ static int add_symlink(const char *service, const char *where) {
         assert(service);
         assert(where);
 
-        from = strjoin(SYSTEM_DATA_UNIT_PATH, "/", service, NULL);
+        from = strjoin(SYSTEM_DATA_UNIT_PATH, "/", service);
         if (!from)
                 return log_oom();
 
-        to = strjoin(arg_dest, "/", where, ".wants/", service, NULL);
+        to = strjoin(arg_dest, "/", where, ".wants/", service);
         if (!to)
                 return log_oom();
 
@@ -62,8 +53,7 @@ static int add_symlink(const char *service, const char *where) {
                 if (errno == EEXIST)
                         return 0;
 
-                log_error_errno(errno, "Failed to create symlink %s: %m", to);
-                return -errno;
+                return log_error_errno(errno, "Failed to create symlink %s: %m", to);
         }
 
         return 1;