summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-06-10 19:21:50 +0200
committerKay Sievers <kay@vrfy.org>2012-06-10 19:21:50 +0200
commitca2e894bdbd06b43800b57074be0e499a3539b0d (patch)
treef07351a39e1713864106e594d1c4fb323642cb87 /src
parent9125670f9a3dc34adf16b87635b460b2e4099b78 (diff)
tmpfiles: print error if basename lookup fails; document it in manpage
Diffstat (limited to 'src')
-rw-r--r--src/tmpfiles/tmpfiles.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index bec73ff6cc..12ec0b2f1b 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -1281,6 +1281,7 @@ static char *resolve_fragment(const char *fragment, const char **search_paths) {
free(resolved_path);
}
+ errno = ENOENT;
return NULL;
}
@@ -1316,7 +1317,14 @@ int main(int argc, char *argv[]) {
int j;
for (j = optind; j < argc; j++) {
- char *fragment = resolve_fragment(argv[j], conf_file_dirs);
+ char *fragment;
+
+ fragment = resolve_fragment(argv[j], conf_file_dirs);
+ if (!fragment) {
+ log_error("Failed to find any: %s file: %m", argv[j]);
+ r = EXIT_FAILURE;
+ goto finish;
+ }
if (read_config_file(fragment, false) < 0)
r = EXIT_FAILURE;
free(fragment);