]> err.no Git - util-linux/commitdiff
libblkid: don't use fstat() in blkid_get_dev_size()
authorKarel Zak <kzak@redhat.com>
Wed, 10 Mar 2010 23:59:47 +0000 (00:59 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 11 Mar 2010 00:08:25 +0000 (01:08 +0100)
We already use fstat() in blkdev_get_size().

Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/getsize.c

index 43b9195b1d7a8bffae88130a34d374db312e2a1c..2ba8bc65bb6d42e0e1939a925b2ad36f0f3dc133 100644 (file)
  */
 blkid_loff_t blkid_get_dev_size(int fd)
 {
-       struct stat st;
        unsigned long long bytes;
 
-       if (fstat(fd, &st) == 0 && S_ISREG(st.st_mode))
-               return st.st_size;
-
        if (blkdev_get_size(fd, &bytes))
                return 0;