summaryrefslogtreecommitdiff
path: root/src/import
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2017-10-04 23:01:32 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-10-04 16:01:32 +0200
commit4c701096002fff540d9ddb3b21398c551ac3af78 (patch)
tree537e654dc92baa5eed5b6ff69867114384ecfa47 /src/import
parent6d0aa4db7b33c9ce71b820c76428a1cfd24fb56f (diff)
downloadsystemd-4c701096002fff540d9ddb3b21398c551ac3af78.tar.gz
tree-wide: use IN_SET macro (#6977)
Diffstat (limited to 'src/import')
-rw-r--r--src/import/import-common.c2
-rw-r--r--src/import/importd.c2
-rw-r--r--src/import/pull-job.c2
-rw-r--r--src/import/qcow2-util.c3
4 files changed, 4 insertions, 5 deletions
diff --git a/src/import/import-common.c b/src/import/import-common.c
index 81209cdaf6..ae71682988 100644
--- a/src/import/import-common.c
+++ b/src/import/import-common.c
@@ -37,7 +37,7 @@ int import_make_read_only_fd(int fd) {
/* First, let's make this a read-only subvolume if it refers
* to a subvolume */
r = btrfs_subvol_set_read_only_fd(fd, true);
- if (r == -ENOTTY || r == -ENOTDIR || r == -EINVAL) {
+ if (IN_SET(r, -ENOTTY, -ENOTDIR, -EINVAL)) {
struct stat st;
/* This doesn't refer to a subvolume, or the file
diff --git a/src/import/importd.c b/src/import/importd.c
index e20aca0d9e..9b3fd06b52 100644
--- a/src/import/importd.c
+++ b/src/import/importd.c
@@ -250,7 +250,7 @@ static void transfer_send_logs(Transfer *t, bool flush) {
n = strndup(t->log_message, e - t->log_message);
/* Skip over NUL and newlines */
- while ((e < t->log_message + t->log_message_size) && (*e == 0 || *e == '\n'))
+ while ((e < t->log_message + t->log_message_size) && IN_SET(*e, 0, '\n'))
e++;
memmove(t->log_message, e, t->log_message + sizeof(t->log_message) - e);
diff --git a/src/import/pull-job.c b/src/import/pull-job.c
index 3e20905d79..995a652ec3 100644
--- a/src/import/pull-job.c
+++ b/src/import/pull-job.c
@@ -108,7 +108,7 @@ void pull_job_curl_on_finished(CurlGlue *g, CURL *curl, CURLcode result) {
if (curl_easy_getinfo(curl, CURLINFO_PRIVATE, (char **)&j) != CURLE_OK)
return;
- if (!j || j->state == PULL_JOB_DONE || j->state == PULL_JOB_FAILED)
+ if (!j || IN_SET(j->state, PULL_JOB_DONE, PULL_JOB_FAILED))
return;
if (result != CURLE_OK) {
diff --git a/src/import/qcow2-util.c b/src/import/qcow2-util.c
index ee2121cc36..00734865b2 100644
--- a/src/import/qcow2-util.c
+++ b/src/import/qcow2-util.c
@@ -213,8 +213,7 @@ static int verify_header(const Header *header) {
if (HEADER_MAGIC(header) != QCOW2_MAGIC)
return -EBADMSG;
- if (HEADER_VERSION(header) != 2 &&
- HEADER_VERSION(header) != 3)
+ if (!IN_SET(HEADER_VERSION(header), 2, 3))
return -EOPNOTSUPP;
if (HEADER_CRYPT_METHOD(header) != 0)