mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-06 13:17:44 +03:00
loop-util: tweak codepath when a loopback file is "created" from an existing block device
Be more careful with initialized of the 'relinquished' boolean field, and let's return the fd, like we do for the regular codepath, too.
This commit is contained in:
parent
26c1be0fdc
commit
16420be1fd
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user