diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-21 03:02:23 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-21 04:03:54 +0100 |
commit | 5a3b1abd0ef47de9984d921463c2aaccc630fad6 (patch) | |
tree | b085900d71849298c72ee1e38c044f203c0ec5a6 /src | |
parent | 90bc083bda5e97064d6a97c855ef7b4868f650de (diff) |
import: improve logging
Diffstat (limited to 'src')
-rw-r--r-- | src/import/import-tar.c | 1 | ||||
-rw-r--r-- | src/import/import.c | 12 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/import/import-tar.c b/src/import/import-tar.c index 08839caae7..e8afc269b7 100644 --- a/src/import/import-tar.c +++ b/src/import/import-tar.c @@ -262,6 +262,7 @@ static int tar_import_job_on_open_disk(ImportJob *j) { safe_close(null_fd); execlp("tar", "tar", "--numeric-owner", "-C", i->temp_path, "-px", NULL); + log_error_errno(errno, "Failed to execute tar: %m"); _exit(EXIT_FAILURE); } diff --git a/src/import/import.c b/src/import/import.c index 62e3118a7f..d9cff3e239 100644 --- a/src/import/import.c +++ b/src/import/import.c @@ -42,10 +42,8 @@ static void on_tar_finished(TarImport *import, int error, void *userdata) { if (error == 0) log_info("Operation completed successfully."); - else - log_error_errno(error, "Operation failed: %m"); - sd_event_exit(event, error); + sd_event_exit(event, EXIT_FAILURE); } static int strip_tar_suffixes(const char *name, char **ret) { @@ -147,7 +145,7 @@ static int pull_tar(int argc, char *argv[], void *userdata) { log_info("Exiting."); - return 0; + return r; } static void on_raw_finished(RawImport *import, int error, void *userdata) { @@ -156,10 +154,8 @@ static void on_raw_finished(RawImport *import, int error, void *userdata) { if (error == 0) log_info("Operation completed successfully."); - else - log_error_errno(error, "Operation failed: %m"); - sd_event_exit(event, error); + sd_event_exit(event, EXIT_FAILURE); } static int strip_raw_suffixes(const char *p, char **ret) { @@ -275,7 +271,7 @@ static int pull_raw(int argc, char *argv[], void *userdata) { log_info("Exiting."); - return 0; + return r; } static void on_dkr_finished(DkrImport *import, int error, void *userdata) { |