]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/path/path.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / path / path.c
index 2f0148f074b12167a0ddefe0dcfdae9d797a52a3..0f029c4ae63dcb4598dd42fa585a187f3bac7b3a 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.
 
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <getopt.h>
 #include <errno.h>
-#include <unistd.h>
+#include <getopt.h>
+#include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include "sd-path.h"
-#include "build.h"
+
+#include "alloc-util.h"
+#include "log.h"
 #include "macro.h"
+#include "string-util.h"
 #include "util.h"
-#include "log.h"
 
 static const char *arg_suffix = NULL;
 
@@ -117,7 +116,7 @@ static int print_home(const char *n) {
         }
 
         log_error("Path %s not known.", n);
-        return -ENOTSUP;
+        return -EOPNOTSUPP;
 }
 
 static void help(void) {
@@ -157,9 +156,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_SUFFIX:
                         arg_suffix = optarg;