Don't close the file descriptor when determining the size.

This bug was introduced in the previous getsize changes, 
and was screwing up the blkid library probe functions.
(Addresses Debian Bug #239191)
bitmap-optimize
Theodore Ts'o 2004-03-21 20:16:19 -05:00
parent abdf84f38a
commit 1cdb6f7602
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2004-03-21 Theodore Ts'o <tytso@mit.edu>
* getsize.c (blkid_get_dev_size): Don't close the file descriptor
when determining the size. This bug was introduced in the
previous getsize changes, and was screwing up the blkid
library probe functions. (Addresses Debian Bug #239191)
2004-03-08 Theodore Ts'o <tytso@mit.edu>
* getsize.c (blkid_get_dev_size): Only use the BLKGETSIZE64 ioctl

View File

@ -89,7 +89,6 @@ blkid_loff_t blkid_get_dev_size(int fd)
if ((sizeof(blkid_loff_t) < sizeof(unsigned long long))
&& ((size64 / (blocksize / 512)) > 0xFFFFFFFF))
return 0; /* EFBIG */
close(fd);
return (blkid_loff_t) size64 << 9;
}
#endif
@ -106,7 +105,6 @@ blkid_loff_t blkid_get_dev_size(int fd)
if ((sizeof(blkid_loff_t) < sizeof(unsigned long long))
&& ((size64) > 0xFFFFFFFF))
return 0; /* EFBIG */
close(fd);
return size64;
}
#endif