projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26c1be0
)
loop-util: tweak codepath when a loopback file is "created" from an existing block...
author
Lennart Poettering
<lennart@poettering.net>
Mon, 31 Dec 2018 16:00:10 +0000
(17:00 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 7 Jan 2019 16:50:39 +0000
(17:50 +0100)
Be more careful with initialized of the 'relinquished' boolean field,
and let's return the fd, like we do for the regular codepath, too.
src/shared/loop-util.c
patch
|
blob
|
history
diff --git
a/src/shared/loop-util.c
b/src/shared/loop-util.c
index e77eee6d3ae28c0c632ccf2f1bd65f6f56cf3791..bf426eb8bca4d2d3a65e13f8d3186ec4b5685182 100644
(file)
--- a/
src/shared/loop-util.c
+++ b/
src/shared/loop-util.c
@@
-45,11
+45,11
@@
int loop_device_make(int fd, int open_flags, LoopDevice **ret) {
*d = (LoopDevice) {
.fd = copy,
.nr = -1,
+ .relinquished = true, /* It's not allocated by us, don't destroy it when this object is freed */
};
*ret = d;
-
- return 0;
+ return d->fd;
}
r = stat_verify_regular(&st);