chiark / gitweb /
Prep v239: Fix conf-parser.[hc], it got a bit mangled by migration.
[elogind.git] / src / shared / conf-parser.c
index 133d8f62c60b968f7eb5cfb96882793a105aa159..472c996423be58577a478487b86f725d9cc655b1 100644 (file)
@@ -1,9 +1,4 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
-/***
-  This file is part of systemd.
-
-  Copyright 2010 Lennart Poettering
-***/
 
 #include <errno.h>
 #include <limits.h>
@@ -26,6 +21,7 @@
 #include "parse-util.h"
 #include "path-util.h"
 #include "process-util.h"
+//#include "rlimit-util.h"
 #include "signal-util.h"
 #include "socket-util.h"
 #include "string-util.h"
 /// Additional includes needed by elogind
 #include "def.h"
 #include "fileio.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
-//#include "rlimit-util.h"
 
 int config_item_table_lookup(
                 const void *table,
@@ -537,6 +521,7 @@ DEFINE_PARSER(nsec, nsec_t, parse_nsec);
 DEFINE_PARSER(sec, usec_t, parse_sec);
 DEFINE_PARSER(mode, mode_t, parse_mode);
 
+#if 0 /// UNNEEDED by elogind
 int config_parse_iec_size(const char* unit,
                             const char *filename,
                             unsigned line,
@@ -567,7 +552,6 @@ int config_parse_iec_size(const char* unit,
         return 0;
 }
 
-#if 0 /// UNNEEDED by elogind
 int config_parse_si_size(
                 const char* unit,
                 const char *filename,
@@ -655,7 +639,7 @@ int config_parse_bool(const char* unit,
                 return fatal ? -ENOEXEC : 0;
         }
 
-        *b = !!k;
+        *b = k;
         return 0;
 }
 
@@ -719,6 +703,7 @@ int config_parse_string(
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int config_parse_path(
                 const char *unit,
                 const char *filename,
@@ -741,10 +726,8 @@ int config_parse_path(
         assert(rvalue);
         assert(data);
 
-        if (isempty(rvalue)) {
-                n = NULL;
+        if (isempty(rvalue))
                 goto finalize;
-        }
 
         n = strdup(rvalue);
         if (!n)
@@ -755,10 +738,9 @@ int config_parse_path(
                 return fatal ? -ENOEXEC : 0;
 
 finalize:
-        free_and_replace(*s, n);
-
-        return 0;
+        return free_and_replace(*s, n);
 }
+#endif // 0
 
 int config_parse_strv(
                 const char *unit,
@@ -806,6 +788,7 @@ int config_parse_strv(
         return 0;
 }
 
+#if 0 /// UNNEEDED by elogind
 int config_parse_warn_compat(
                 const char *unit,
                 const char *filename,
@@ -841,7 +824,6 @@ int config_parse_warn_compat(
         return 0;
 }
 
-#if 0 /// UNNEEDED by elogind
 int config_parse_log_facility(
                 const char *unit,
                 const char *filename,
@@ -871,7 +853,6 @@ int config_parse_log_facility(
 
         return 0;
 }
-#endif // 0
 
 int config_parse_log_level(
                 const char *unit,
@@ -935,7 +916,6 @@ int config_parse_signal(
         return 0;
 }
 
-#if 0 /// UNNEEDED by elogind
 int config_parse_personality(
                 const char *unit,
                 const char *filename,
@@ -1157,8 +1137,7 @@ int config_parse_join_controllers(
 
         return 0;
 }
-#endif // 0
-
+x
 int config_parse_mtu(
                 const char *unit,
                 const char *filename,
@@ -1263,3 +1242,4 @@ int config_parse_permille(const char* unit,
 
         return 0;
 }
+#endif // 0