summaryrefslogtreecommitdiff
path: root/src/core/umount.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-24 19:45:16 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-31 14:36:12 -0400
commite62d8c3944745ed276e6d4f33153009860e5cfc5 (patch)
treee7f70ed3b80581017b6340723ab6f1d6b9c30bad /src/core/umount.c
parent3c8bed4ee061f96acb4d70a591a9849bddd2a659 (diff)
Modernization
Use _cleanup_ and wrap lines to ~80 chars and such.
Diffstat (limited to 'src/core/umount.c')
-rw-r--r--src/core/umount.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/umount.c b/src/core/umount.c
index 3fcb90eca4..95e47e3c5a 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -379,12 +379,14 @@ static int delete_loopback(const char *device) {
}
static int delete_dm(dev_t devnum) {
- int fd, r;
+ int _cleanup_close_ fd = -1;
+ int r;
struct dm_ioctl dm;
assert(major(devnum) != 0);
- if ((fd = open("/dev/mapper/control", O_RDWR|O_CLOEXEC)) < 0)
+ fd = open("/dev/mapper/control", O_RDWR|O_CLOEXEC);
+ if (fd < 0)
return -errno;
zero(dm);
@@ -396,8 +398,6 @@ static int delete_dm(dev_t devnum) {
dm.dev = devnum;
r = ioctl(fd, DM_DEV_REMOVE, &dm);
- close_nointr_nofail(fd);
-
return r >= 0 ? 0 : -errno;
}