diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-07-22 10:55:10 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-07-22 14:10:31 +0900 |
commit | 337874a45fff46a80e4974c681a5e651f3a0fac9 (patch) | |
tree | 044c67e40167a229390ef80d0e20edd7e532db02 | |
parent | 2e4effd129343d22bfed34e94810d3f87c8f0e85 (diff) | |
download | systemd-337874a45fff46a80e4974c681a5e651f3a0fac9.tar.gz |
pstopre: fix return value of list_files()
Previously, the return value of the last read_full_file() is returned.
This makes the error in read_full_file() is always ignored.
-rw-r--r-- | src/pstore/pstore.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c index 0febbcb716..86361d8ebc 100644 --- a/src/pstore/pstore.c +++ b/src/pstore/pstore.c @@ -314,7 +314,7 @@ static void process_dmesg_files(PStoreList *list) { static int list_files(PStoreList *list, const char *sourcepath) { _cleanup_(closedirp) DIR *dirp = NULL; struct dirent *de; - int r = 0; + int r; dirp = opendir(sourcepath); if (!dirp) @@ -333,7 +333,7 @@ static int list_files(PStoreList *list, const char *sourcepath) { /* Now read contents of pstore file */ r = read_full_file(ifd_path, &buf, &buf_size); if (r < 0) { - log_warning_errno(r, "Failed to read file %s: %m", ifd_path); + log_warning_errno(r, "Failed to read file %s, skipping: %m", ifd_path); continue; } @@ -349,7 +349,7 @@ static int list_files(PStoreList *list, const char *sourcepath) { }; } - return r; + return 0; } static int run(int argc, char *argv[]) { |