chiark / gitweb /
fileio: in envfiles, do not skip lines following empty lines
[elogind.git] / src / shared / install.c
index 2555a36c0a9226c5cfa9f95631b408b717c937df..71e04335ef57371cd84d2c661ae419759fbaac3d 100644 (file)
@@ -700,7 +700,7 @@ int unit_file_link(
                 UnitFileChange **changes,
                 unsigned *n_changes) {
 
-        LookupPaths _cleanup_lookup_paths_free_ paths = {NULL};
+        LookupPaths _cleanup_lookup_paths_free_ paths = {};
         char **i;
         char _cleanup_free_ *config_path = NULL;
         int r, q;
@@ -1116,7 +1116,7 @@ static int unit_file_can_install(
                 const char *name,
                 bool allow_symlink) {
 
-        InstallContext _cleanup_install_context_done_ c = {NULL};
+        InstallContext _cleanup_install_context_done_ c = {};
         InstallInfo *i;
         int r;
 
@@ -1452,8 +1452,8 @@ int unit_file_enable(
                 UnitFileChange **changes,
                 unsigned *n_changes) {
 
-        LookupPaths _cleanup_lookup_paths_free_ paths = {NULL};
-        InstallContext _cleanup_install_context_done_ c = {NULL};
+        LookupPaths _cleanup_lookup_paths_free_ paths = {};
+        InstallContext _cleanup_install_context_done_ c = {};
         char **i;
         char _cleanup_free_ *config_path = NULL;
         int r;
@@ -1491,8 +1491,8 @@ int unit_file_disable(
                 UnitFileChange **changes,
                 unsigned *n_changes) {
 
-        LookupPaths _cleanup_lookup_paths_free_ paths = {NULL};
-        InstallContext _cleanup_install_context_done_ c = {NULL};
+        LookupPaths _cleanup_lookup_paths_free_ paths = {};
+        InstallContext _cleanup_install_context_done_ c = {};
         char **i;
         char _cleanup_free_ *config_path = NULL;
         Set _cleanup_set_free_free_ *remove_symlinks_to = NULL;
@@ -1533,8 +1533,8 @@ int unit_file_reenable(
                 UnitFileChange **changes,
                 unsigned *n_changes) {
 
-        LookupPaths _cleanup_lookup_paths_free_ paths = {NULL};
-        InstallContext _cleanup_install_context_done_ c = {NULL};
+        LookupPaths _cleanup_lookup_paths_free_ paths = {};
+        InstallContext _cleanup_install_context_done_ c = {};
         char **i;
         char _cleanup_free_ *config_path = NULL;
         Set _cleanup_set_free_free_ *remove_symlinks_to = NULL;
@@ -1576,7 +1576,7 @@ UnitFileState unit_file_get_state(
                 const char *root_dir,
                 const char *name) {
 
-        LookupPaths _cleanup_lookup_paths_free_ paths = {NULL};
+        LookupPaths _cleanup_lookup_paths_free_ paths = {};
         UnitFileState state = _UNIT_FILE_STATE_INVALID;
         char **i;
         char _cleanup_free_ *path = NULL;
@@ -1637,7 +1637,7 @@ UnitFileState unit_file_get_state(
                         return state;
 
                 r = unit_file_can_install(&paths, root_dir, path, true);
-                if (r < 0 && errno != -ENOENT)
+                if (r < 0 && errno != ENOENT)
                         return r;
                 else if (r > 0)
                         return UNIT_FILE_DISABLED;
@@ -1699,7 +1699,7 @@ int unit_file_query_preset(UnitFileScope scope, const char *name) {
                         if (!*l)
                                 continue;
 
-                        if (strchr(COMMENTS, *l))
+                        if (strchr(COMMENTS "\n", *l))
                                 continue;
 
                         if (first_word(l, "enable")) {
@@ -1734,8 +1734,8 @@ int unit_file_preset(
                 UnitFileChange **changes,
                 unsigned *n_changes) {
 
-        LookupPaths _cleanup_lookup_paths_free_ paths = {NULL};
-        InstallContext _cleanup_install_context_done_ plus = {NULL}, minus = {NULL};
+        LookupPaths _cleanup_lookup_paths_free_ paths = {};
+        InstallContext _cleanup_install_context_done_ plus = {}, minus = {};
         char **i;
         char _cleanup_free_ *config_path = NULL;
         Set _cleanup_set_free_free_ *remove_symlinks_to = NULL;
@@ -1800,7 +1800,7 @@ int unit_file_get_list(
                 const char *root_dir,
                 Hashmap *h) {
 
-        LookupPaths _cleanup_lookup_paths_free_ paths = {NULL};
+        LookupPaths _cleanup_lookup_paths_free_ paths = {};
         char **i;
         char _cleanup_free_ *buf = NULL;
         DIR _cleanup_closedir_ *d = NULL;