diff options
author | Neil Brown <neilb@suse.de> | 2008-04-29 17:13:55 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-04-29 17:13:55 +1000 |
commit | c2c9bb6fe04fe2800fcda3ff285b16ca9ecd38ae (patch) | |
tree | 7de419da432add1fde71dbd8dfcd91a67a235ade /util.c | |
parent | 519561f73f7ba987affde8b174d2691bb098439d (diff) | |
download | mdadm-c2c9bb6fe04fe2800fcda3ff285b16ca9ecd38ae.tar.gz mdadm-c2c9bb6fe04fe2800fcda3ff285b16ca9ecd38ae.tar.xz mdadm-c2c9bb6fe04fe2800fcda3ff285b16ca9ecd38ae.zip |
diff -ru mdadm-2.6.4-orig/Query.c mdadm-2.6.4/Query.c
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -830,6 +830,11 @@ struct supertype *guess_super(int fd) int get_dev_size(int fd, char *dname, unsigned long long *sizep) { unsigned long long ldsize; + struct stat st; + + if (fstat(fd, &st) != -1 && S_ISREG(st.st_mode)) + ldsize = (unsigned long long)st.st_size; + else #ifdef BLKGETSIZE64 if (ioctl(fd, BLKGETSIZE64, &ldsize) != 0) #endif |