Only attempt to clear the server-logs lock when previously set by this same server.

This commit is contained in:
Yang Tse 2009-11-26 10:15:08 +00:00
parent fba233bb34
commit cbd527843b
4 changed files with 69 additions and 13 deletions

View file

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -260,6 +260,12 @@ void clear_advisor_read_lock(const char *filename)
int error = 0;
int res;
/*
** Log all removal failures. Even those due to file not existing.
** This allows to detect if unexpectedly the file has already been
** removed by a process different than the one that should do this.
*/
do {
res = unlink(filename);
} while(res && ((error = ERRNO) == EINTR));