projects
/
harmattan
/
cameraplus
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
75b3dbb
)
If the user has a lot of free space (8 GB for example)
author
Mohammed Sameer
<msameer@foolab.org>
Sun, 24 Feb 2013 16:58:17 +0000
(18:58 +0200)
committer
Mohammed Sameer
<msameer@foolab.org>
Sun, 24 Feb 2013 16:58:17 +0000
(18:58 +0200)
then we will overflow the unsigned long int thus we use a 64 bits "int"
src/fsmonitor.cpp
patch
|
blob
|
history
diff --git
a/src/fsmonitor.cpp
b/src/fsmonitor.cpp
index
0174d2a
..
1a5d2f2
100644
(file)
--- a/
src/fsmonitor.cpp
+++ b/
src/fsmonitor.cpp
@@
-64,5
+64,8
@@
bool FSMonitor::hasFreeSpace(const QString& path) {
return false;
}
- return (buf.f_bsize * buf.f_bavail >= MIN_SPACE);
+ // If the user has a lot of free space (8 GB for example)
+ // then we will overflow the unsigned long int thus we use a 64 bits "int"
+ quint64 freeSpace = (quint64)buf.f_bsize * (quint64)buf.f_bavail;
+ return (freeSpace >= MIN_SPACE);
}