diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-20 15:42:57 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-20 18:40:02 +0100 |
commit | 294bf0c34a53caa25709b794bfeee6a00a2b6ecd (patch) | |
tree | a429db1ca92924ac73959a0ed9954161e22612dd /src/basic/conf-files.c | |
parent | 0166c42868813d5d96b500277f6f819eef498b95 (diff) | |
download | systemd-294bf0c34a53caa25709b794bfeee6a00a2b6ecd.tar.gz |
Split out pretty-print.c and move pager.c and main-func.h to shared/
This is high-level functionality, and fits better in shared/ (which is for
our executables), than in basic/ (which is also for libraries).
Diffstat (limited to 'src/basic/conf-files.c')
-rw-r--r-- | src/basic/conf-files.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/basic/conf-files.c b/src/basic/conf-files.c index d03366077d..7b44ae277d 100644 --- a/src/basic/conf-files.c +++ b/src/basic/conf-files.c @@ -328,36 +328,3 @@ int conf_files_list_with_replacement( *replace_file = TAKE_PTR(p); return 0; } - -int conf_files_cat(const char *root, const char *name) { - _cleanup_strv_free_ char **dirs = NULL, **files = NULL; - _cleanup_free_ char *path = NULL; - const char *dir; - char **t; - int r; - - NULSTR_FOREACH(dir, CONF_PATHS_NULSTR("")) { - assert(endswith(dir, "/")); - r = strv_extendf(&dirs, "%s%s.d", dir, name); - if (r < 0) - return log_error_errno(r, "Failed to build directory list: %m"); - } - - r = conf_files_list_strv(&files, ".conf", root, 0, (const char* const*) dirs); - if (r < 0) - return log_error_errno(r, "Failed to query file list: %m"); - - path = path_join(root, "/etc", name); - if (!path) - return log_oom(); - - if (DEBUG_LOGGING) { - log_debug("Looking for configuration in:"); - log_debug(" %s", path); - STRV_FOREACH(t, dirs) - log_debug(" %s/*.conf", *t); - } - - /* show */ - return cat_files(path, files, CAT_FLAGS_MAIN_FILE_OPTIONAL); -} |