git://developer.intra2net.com
/
libi2ncommon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
a9f2ccc
)
add safeguard against infinite loop with EINTR, even if that case is very unlikely
author
Gerd von Egidy
<gerd.von.egidy@intra2net.com>
Wed, 16 Dec 2015 14:33:09 +0000 (15:33 +0100)
committer
Gerd von Egidy
<gerd.von.egidy@intra2net.com>
Wed, 16 Dec 2015 14:33:09 +0000 (15:33 +0100)
src/filefunc.cpp
patch
|
blob
|
blame
|
history
diff --git
a/src/filefunc.cpp
b/src/filefunc.cpp
index
6f07011
..
3a7f7c1
100644
(file)
--- a/
src/filefunc.cpp
+++ b/
src/filefunc.cpp
@@
-968,8
+968,10
@@
long long get_free_diskspace(const std::string& path)
{
struct statvfs sf;
+ int looplimit=10000;
int ret;
- while ( ((ret=statvfs(path.c_str(),&sf)) == -1) && (errno==EINTR) );
+ while ( ((ret=statvfs(path.c_str(),&sf)) == -1) && (errno==EINTR) && looplimit > 0)
+ looplimit--;
if (ret==-1)
{