summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-05-30 22:02:57 +0200
committerGitHub <noreply@github.com>2022-05-30 22:02:57 +0200
commit9a18321058f6be28cccb97fd8f1d70bcbc1e237d (patch)
tree03af814ed6f5b8219a20893ada2eaf557dd9e0f0 /src
parentMerge pull request #23565 from bnf/man-nspawn-wording (diff)
parentcoccinelle: don't try to use IN_SET() in assert_cc() (diff)
downloadsystemd-9a18321058f6be28cccb97fd8f1d70bcbc1e237d.tar.xz
systemd-9a18321058f6be28cccb97fd8f1d70bcbc1e237d.zip
Merge pull request #23560 from mrc0mmand/coccinelle
A couple of tweaks suggested by Coccinelle
Diffstat (limited to 'src')
-rw-r--r--src/analyze/analyze-compare-versions.c2
-rw-r--r--src/journal/managed-journal-file.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/src/analyze/analyze-compare-versions.c b/src/analyze/analyze-compare-versions.c
index 9d9f7ed3cb..202b8a7d09 100644
--- a/src/analyze/analyze-compare-versions.c
+++ b/src/analyze/analyze-compare-versions.c
@@ -10,7 +10,7 @@
int verb_compare_versions(int argc, char *argv[], void *userdata) {
int r;
- assert(argc == 3 || argc == 4);
+ assert(IN_SET(argc, 3, 4));
assert(argv);
if (argc == 3) {
diff --git a/src/journal/managed-journal-file.c b/src/journal/managed-journal-file.c
index 52aee7be98..5c34d14ddc 100644
--- a/src/journal/managed-journal-file.c
+++ b/src/journal/managed-journal-file.c
@@ -93,10 +93,9 @@ static int managed_journal_file_entry_array_punch_hole(JournalFile *f, uint64_t
}
if (fallocate(f->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, offset, sz) < 0) {
- if (ERRNO_IS_NOT_SUPPORTED(errno)) {
- log_debug("Hole punching not supported by backing file system, skipping.");
- return -EOPNOTSUPP; /* Make recognizable */
- }
+ if (ERRNO_IS_NOT_SUPPORTED(errno))
+ return log_debug_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), /* Make recognizable */
+ "Hole punching not supported by backing file system, skipping.");
return log_debug_errno(errno, "Failed to punch hole in entry array of %s: %m", f->path);
}