diff options
author | Sascha Sommer | 2007-08-21 15:13:43 +0200 |
---|---|---|
committer | Karel Zak | 2007-08-27 10:22:06 +0200 |
commit | 5c62eb4d06c83f21aa14244468a44c48c173493d (patch) | |
tree | 2bb3f877d707da2957bf7f838c5760184c9ef4bd /mount/lomount.c | |
parent | mount: avoid duplicates for root fs in mtab (diff) | |
download | kernel-qcow2-util-linux-5c62eb4d06c83f21aa14244468a44c48c173493d.tar.gz kernel-qcow2-util-linux-5c62eb4d06c83f21aa14244468a44c48c173493d.tar.xz kernel-qcow2-util-linux-5c62eb4d06c83f21aa14244468a44c48c173493d.zip |
mount: free loop device on failure
Testcase:
$ mount -oloop /etc/group /mnt
ioctl: LOOP_CLR_FD: Device or resource busy
mount: you must specify the filesystem type
$ losetup /dev/loop0
/dev/loop0: [0803]:1931929 (/etc/group)
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Diffstat (limited to 'mount/lomount.c')
-rw-r--r-- | mount/lomount.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mount/lomount.c b/mount/lomount.c index ae9eb36e7..ace474cb3 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -398,6 +398,7 @@ del_loop (const char *device) { } if (ioctl (fd, LOOP_CLR_FD, 0) < 0) { perror ("ioctl: LOOP_CLR_FD"); + close(fd); return 1; } close (fd); |