mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
pull: use ASSERT_PTR() to shorten code a tiny bit
This commit is contained in:
@@ -500,13 +500,10 @@ static int raw_pull_rename_auxiliary_file(
|
||||
}
|
||||
|
||||
static void raw_pull_job_on_finished(PullJob *j) {
|
||||
RawPull *i;
|
||||
int r;
|
||||
|
||||
assert(j);
|
||||
assert(j->userdata);
|
||||
|
||||
i = j->userdata;
|
||||
RawPull *i = ASSERT_PTR(j->userdata);
|
||||
|
||||
if (j->error != 0) {
|
||||
/* Only the main job and the checksum job are fatal if they fail. The other fails are just
|
||||
|
||||
@@ -399,13 +399,10 @@ static bool tar_pull_is_done(TarPull *i) {
|
||||
}
|
||||
|
||||
static void tar_pull_job_on_finished(PullJob *j) {
|
||||
TarPull *i;
|
||||
int r;
|
||||
|
||||
assert(j);
|
||||
assert(j->userdata);
|
||||
|
||||
i = j->userdata;
|
||||
TarPull *i = ASSERT_PTR(j->userdata);
|
||||
|
||||
if (j->error != 0) {
|
||||
clear_progress_bar(/* prefix= */ NULL);
|
||||
@@ -582,13 +579,11 @@ finish:
|
||||
|
||||
static int tar_pull_job_on_open_disk_tar(PullJob *j) {
|
||||
const char *where;
|
||||
TarPull *i;
|
||||
int r;
|
||||
|
||||
assert(j);
|
||||
assert(j->userdata);
|
||||
|
||||
i = j->userdata;
|
||||
TarPull *i = ASSERT_PTR(j->userdata);
|
||||
assert(i->tar_job == j);
|
||||
assert(!pidref_is_set(&i->tar_pid));
|
||||
assert(i->tree_fd < 0);
|
||||
|
||||
Reference in New Issue
Block a user