summaryrefslogtreecommitdiff
path: root/src/import/import-raw.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-09-16 15:36:44 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-09-18 15:28:48 +0200
commit0706c012598eee8372fb5d4ca6688ac5fb2380a4 (patch)
treec7764980023b427bcabbafa4813ae272681ffdb9 /src/import/import-raw.c
parent831d57953e8e688128bc0f871d4b4213459842ba (diff)
downloadsystemd-0706c012598eee8372fb5d4ca6688ac5fb2380a4.tar.gz
Add CLOSE_AND_REPLACE helper
Similar to free_and_replace. I think this should be uppercase to make it clear that this is a macro. free_and_replace should probably be uppercased too.
Diffstat (limited to 'src/import/import-raw.c')
-rw-r--r--src/import/import-raw.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c
index 0606cf5406..7e9f3441f4 100644
--- a/src/import/import-raw.c
+++ b/src/import/import-raw.c
@@ -185,9 +185,7 @@ static int raw_import_maybe_convert_qcow2(RawImport *i) {
(void) unlink(i->temp_path);
free_and_replace(i->temp_path, t);
-
- safe_close(i->output_fd);
- i->output_fd = TAKE_FD(converted_fd);
+ CLOSE_AND_REPLACE(i->output_fd, converted_fd);
return 1;
}