On Wed, 2010-05-26 at 16:59 +0200, Denys Vlasenko wrote:
On Tue, 2010-05-25 at 16:20 +0200, Karel Klic wrote:
Hi,
All patches attached, but only 0002-* is updated. Please see comments below.
I see that you implemented timing out connections! Nice!
- char *newpath = xstrndup(path, strlen(path) - strlen(".new"));
- if (rename(path, newpath) != 0)
strcpy(path, newpath);
...
- if (maxCrashReportsSize > 0)
- {
check_free_space(maxCrashReportsSize);
trim_debug_dumps(maxCrashReportsSize, path);
- }
I think this is a originally my bug, should be ==, not !=: if (rename(path, newpath) == 0) strcpy(path, newpath); because the goal of strcpy is to set path to the name of directory which must not be deleted by trim_debug_dumps(). If rename() == 0 [that is, it succeeded], now the name is "newpath", and we must use it, not "path".
I fixed it in both locations and committed fix to git.