summaryrefslogtreecommitdiffstats
path: root/src/import
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-04-05 07:26:26 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-04-05 07:26:26 +0200
commit1cc6c93a9569a9f2664d0d26cd0e50408307c430 (patch)
tree57e115a1beb9b097f731da79c3192015ff35cc94 /src/import
parentnetwork: fix typo in log message (diff)
downloadsystemd-1cc6c93a9569a9f2664d0d26cd0e50408307c430.tar.xz
systemd-1cc6c93a9569a9f2664d0d26cd0e50408307c430.zip
tree-wide: use TAKE_PTR() and TAKE_FD() macros
Diffstat (limited to 'src/import')
-rw-r--r--src/import/curl-util.c3
-rw-r--r--src/import/export-raw.c3
-rw-r--r--src/import/export-tar.c3
-rw-r--r--src/import/import-raw.c3
-rw-r--r--src/import/import-tar.c3
-rw-r--r--src/import/importd.c6
-rw-r--r--src/import/pull-common.c3
-rw-r--r--src/import/pull-job.c3
-rw-r--r--src/import/pull-raw.c3
-rw-r--r--src/import/pull-tar.c3
10 files changed, 11 insertions, 22 deletions
diff --git a/src/import/curl-util.c b/src/import/curl-util.c
index 62bbaa500d..94315f1f7b 100644
--- a/src/import/curl-util.c
+++ b/src/import/curl-util.c
@@ -272,8 +272,7 @@ int curl_glue_new(CurlGlue **glue, sd_event *event) {
if (curl_multi_setopt(g->curl, CURLMOPT_TIMERFUNCTION, curl_glue_timer_callback) != CURLM_OK)
return -EINVAL;
- *glue = g;
- g = NULL;
+ *glue = TAKE_PTR(g);
return 0;
}
diff --git a/src/import/export-raw.c b/src/import/export-raw.c
index 9cab838b96..bdad19f1ea 100644
--- a/src/import/export-raw.c
+++ b/src/import/export-raw.c
@@ -122,8 +122,7 @@ int raw_export_new(
return r;
}
- *ret = e;
- e = NULL;
+ *ret = TAKE_PTR(e);
return 0;
}
diff --git a/src/import/export-tar.c b/src/import/export-tar.c
index dafe3e1c88..ef444008d9 100644
--- a/src/import/export-tar.c
+++ b/src/import/export-tar.c
@@ -126,8 +126,7 @@ int tar_export_new(
return r;
}
- *ret = e;
- e = NULL;
+ *ret = TAKE_PTR(e);
return 0;
}
diff --git a/src/import/import-raw.c b/src/import/import-raw.c
index 032b3dcda2..7f6a720274 100644
--- a/src/import/import-raw.c
+++ b/src/import/import-raw.c
@@ -141,8 +141,7 @@ int raw_import_new(
return r;
}
- *ret = i;
- i = NULL;
+ *ret = TAKE_PTR(i);
return 0;
}
diff --git a/src/import/import-tar.c b/src/import/import-tar.c
index 09c7654adc..1c03308628 100644
--- a/src/import/import-tar.c
+++ b/src/import/import-tar.c
@@ -148,8 +148,7 @@ int tar_import_new(
return r;
}
- *ret = i;
- i = NULL;
+ *ret = TAKE_PTR(i);
return 0;
}
diff --git a/src/import/importd.c b/src/import/importd.c
index 55e61b485f..220ac7e795 100644
--- a/src/import/importd.c
+++ b/src/import/importd.c
@@ -187,8 +187,7 @@ static int transfer_new(Manager *m, Transfer **ret) {
t->manager = m;
t->id = id;
- *ret = t;
- t = NULL;
+ *ret = TAKE_PTR(t);
return 0;
}
@@ -639,8 +638,7 @@ static int manager_new(Manager **ret) {
if (r < 0)
return r;
- *ret = m;
- m = NULL;
+ *ret = TAKE_PTR(m);
return 0;
}
diff --git a/src/import/pull-common.c b/src/import/pull-common.c
index 92f2692c81..dcd07d49b2 100644
--- a/src/import/pull-common.c
+++ b/src/import/pull-common.c
@@ -258,8 +258,7 @@ int pull_make_auxiliary_job(
job->on_finished = on_finished;
job->compressed_max = job->uncompressed_max = 1ULL * 1024ULL * 1024ULL;
- *ret = job;
- job = NULL;
+ *ret = TAKE_PTR(job);
return 0;
}
diff --git a/src/import/pull-job.c b/src/import/pull-job.c
index 2b71766798..0d5f2d2086 100644
--- a/src/import/pull-job.c
+++ b/src/import/pull-job.c
@@ -581,8 +581,7 @@ int pull_job_new(PullJob **ret, const char *url, CurlGlue *glue, void *userdata)
if (!j->url)
return -ENOMEM;
- *ret = j;
- j = NULL;
+ *ret = TAKE_PTR(j);
return 0;
}
diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c
index 9784141871..ce0dea43a5 100644
--- a/src/import/pull-raw.c
+++ b/src/import/pull-raw.c
@@ -166,8 +166,7 @@ int raw_pull_new(
i->glue->on_finished = pull_job_curl_on_finished;
i->glue->userdata = i;
- *ret = i;
- i = NULL;
+ *ret = TAKE_PTR(i);
return 0;
}
diff --git a/src/import/pull-tar.c b/src/import/pull-tar.c
index 6ee63bdad5..10772fbaca 100644
--- a/src/import/pull-tar.c
+++ b/src/import/pull-tar.c
@@ -159,8 +159,7 @@ int tar_pull_new(
i->glue->on_finished = pull_job_curl_on_finished;
i->glue->userdata = i;
- *ret = i;
- i = NULL;
+ *ret = TAKE_PTR(i);
return 0;
}