forked from vitalif/vitastor
Fix opening regular files as blockstore
parent
3f33095fd7
commit
999bed8514
|
@ -306,6 +306,10 @@ static void check_size(int fd, uint64_t *size, uint64_t *sectsize, std::string n
|
||||||
if (S_ISREG(st.st_mode))
|
if (S_ISREG(st.st_mode))
|
||||||
{
|
{
|
||||||
*size = st.st_size;
|
*size = st.st_size;
|
||||||
|
if (sectsize)
|
||||||
|
{
|
||||||
|
*sectsize = st.st_blksize;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (S_ISBLK(st.st_mode))
|
else if (S_ISBLK(st.st_mode))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue