From c4ab01b36507a4e50e59c9c0adc06dcb5e587b60 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Mon, 13 Oct 2003 21:22:28 +0000 Subject: make sure loopfd is still open so we can close it in an error case (#106615) --- loader2/method.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'loader2/method.c') 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; } -- cgit