summaryrefslogtreecommitdiffstats
path: root/loader2/method.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-10-13 21:22:28 +0000
committerJeremy Katz <katzj@redhat.com>2003-10-13 21:22:28 +0000
commitc4ab01b36507a4e50e59c9c0adc06dcb5e587b60 (patch)
tree2ff871aab96aa28e3d8c64903ef9b7342737192d /loader2/method.c
parentb6a6e44315ec0bebd745fc3b485ee04be263a5e5 (diff)
downloadanaconda-c4ab01b36507a4e50e59c9c0adc06dcb5e587b60.tar.gz
anaconda-c4ab01b36507a4e50e59c9c0adc06dcb5e587b60.tar.xz
anaconda-c4ab01b36507a4e50e59c9c0adc06dcb5e587b60.zip
make sure loopfd is still open so we can close it in an error case (#106615)
Diffstat (limited to 'loader2/method.c')
-rw-r--r--loader2/method.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/loader2/method.c b/loader2/method.c
index 37b95886c..0a9694462 100644
--- a/loader2/method.c
+++ b/loader2/method.c
@@ -118,8 +118,6 @@ int mountLoopback(char * fsystem, char * mntpoint, char * device) {
return LOADER_ERROR;
}
- close(loopfd);
-
if (doPwMount(filename, mntpoint, "iso9660", 1,
0, NULL, NULL, 0, 0)) {
if (doPwMount(filename, mntpoint, "ext2", 1,
@@ -129,11 +127,14 @@ int mountLoopback(char * fsystem, char * mntpoint, char * device) {
logMessage("failed to mount loop: %s",
strerror(errno));
ioctl(loopfd, LOOP_CLR_FD, 0);
+ close(loopfd);
return LOADER_ERROR;
}
}
}
+ close(loopfd);
+
return 0;
}