Patch from vodz:
[oweals/busybox.git] / libbb / loop.c
index 29128abe4b728394cc99d029b1c9355e8d780089..7dba3e274b85ee19edce518d3f6dfc676a317b9b 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Utility routines.
  *
- * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+ * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ extern int del_loop(const char *device)
                return (FALSE);
        }
        if (ioctl(fd, LOOP_CLR_FD, 0) < 0) {
+               close(fd);
                bb_perror_msg("ioctl: LOOP_CLR_FD");
                return (FALSE);
        }